summaryrefslogtreecommitdiff
path: root/src/vehicle.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-08-29 21:27:16 +0000
committerrubidium <rubidium@openttd.org>2007-08-29 21:27:16 +0000
commitdc8019575404425b52abc121c6bd9159596fee87 (patch)
treec750fba2dc3e7efcc74cbccf329c29e874b3102e /src/vehicle.h
parentfff12fd22e6e526c7a8259606bb9235f1ed97e06 (diff)
downloadopenttd-dc8019575404425b52abc121c6bd9159596fee87.tar.xz
(svn r10999) -Codechange: unify the way the running cost of a vehicle is determined. Patch by nycom.
Diffstat (limited to 'src/vehicle.h')
-rw-r--r--src/vehicle.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/vehicle.h b/src/vehicle.h
index 8b7e29796..b07aa44d4 100644
--- a/src/vehicle.h
+++ b/src/vehicle.h
@@ -427,10 +427,22 @@ 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; }
};