I'm not sure if this is a good way to do it but I just had this idea of a way in which you could use overridden methods.
You have a base vehicle type which is abstract. That means you cannot make an actual vehicle - it is a template.
A vehicle variable can accept any type that extends from it. Here we have smallship and largeship. Each ship has a different upgrade method, and you would put any actions unique to a type of ship in its own type. Only common actions are placed in vehicle.
You have a base vehicle type which is abstract. That means you cannot make an actual vehicle - it is a template.
A vehicle variable can accept any type that extends from it. Here we have smallship and largeship. Each ship has a different upgrade method, and you would put any actions unique to a type of ship in its own type. Only common actions are placed in vehicle.
Type vehicle Abstract Method upgrade:vehicle() Abstract Method move() 'assuming all vehicles move in the same way put common code in this type End Method End Type Type smallship Extends vehicle Method upgrade:vehicle() Local newvehicle:vehicle = New largeship Return newvehicle End Method End Type Type largeship Extends vehicle Method upgrade:vehicle() Local newvehicle:vehicle = New nextship Return newvehicle End Method End Type ''''''''' Local player:vehicle = New smallship player = player.upgrade() 'now a bigship