diff options
author | maedhros <maedhros@openttd.org> | 2007-06-01 12:03:10 +0000 |
---|---|---|
committer | maedhros <maedhros@openttd.org> | 2007-06-01 12:03:10 +0000 |
commit | 4acf3e4c3f4aebf66b82cc1d33aab221d27d800c (patch) | |
tree | ecdd71bd76175d9e15732fad8068a2c2abcb1de2 /src/vehicle.h | |
parent | ab8503f5a5a377a38b6a0ce36a6170c4f83c6b37 (diff) | |
download | openttd-4acf3e4c3f4aebf66b82cc1d33aab221d27d800c.tar.xz |
(svn r10009) -Codechange: Add and use Vehicle::IsPrimaryVehicle to replace individual checks depending on the vehicle type.
Diffstat (limited to 'src/vehicle.h')
-rw-r--r-- | src/vehicle.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/vehicle.h b/src/vehicle.h index f1f9aa481..ed5812420 100644 --- a/src/vehicle.h +++ b/src/vehicle.h @@ -399,6 +399,17 @@ struct Vehicle { * Play the sound associated with leaving the station */ virtual void PlayLeaveStationSound() const {} + + /** + * Whether this is the primary vehicle in the chain. + */ + virtual bool IsPrimaryVehicle() const { return false; } + + /** + * Whether this vehicle understands the concept of a front engine, so + * basically, if GetFirstVehicleInChain() can be called for it. + */ + virtual bool HasFront() const { return false; } }; /** |