(svn r10999) -Codechange: unify the way the running cost of a vehicle is determined. Patch by nycom.

This commit is contained in:
rubidium
2007-08-29 21:27:16 +00:00
parent fff12fd22e
commit dc80195754
10 changed files with 46 additions and 22 deletions

View File

@@ -426,11 +426,23 @@ struct Vehicle : PoolItem<Vehicle, VehicleID, &_Vehicle_pool> {
*/
virtual int GetDisplayMaxSpeed() const { return 0; }
/**
* Gets the running cost of a vehicle
* @return the vehicle's running cost
*/
virtual Money GetRunningCost() const { return 0; }
/**
* Calls the tick handler of the vehicle
*/
virtual void Tick() {};
/**
* Gets the running cost of a vehicle that can be sent into SetDParam for string processing.
* @return the vehicle's running cost
*/
Money GetDisplayRunningCost() const { return (this->GetRunningCost() >> 8); }
bool IsValid() const { return this->type != VEH_INVALID; }
};