summaryrefslogtreecommitdiff
path: root/src/vehicle.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-15 11:28:22 +0000
committerrubidium <rubidium@openttd.org>2007-05-15 11:28:22 +0000
commit23492f1f34bf45266e319d4f2c7e2ffcb8dc483c (patch)
tree5302883001c15ce5eca3dfd6a763cf1108b5e752 /src/vehicle.h
parenta390db6941fa5911e92d39e2f926df16dc4af984 (diff)
downloadopenttd-23492f1f34bf45266e319d4f2c7e2ffcb8dc483c.tar.xz
(svn r9841) -Codechange: add a little more type strictness to the vehicle types.
Diffstat (limited to 'src/vehicle.h')
-rw-r--r--src/vehicle.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/vehicle.h b/src/vehicle.h
index ccd918521..81efc6293 100644
--- a/src/vehicle.h
+++ b/src/vehicle.h
@@ -64,15 +64,18 @@ enum RoadVehicleStates {
RVSB_ROAD_STOP_TRACKDIR_MASK = 0x09 ///< Only bits 0 and 3 are used to encode the trackdir for road stops
};
-enum {
+enum VehicleType {
VEH_TRAIN,
VEH_ROAD,
VEH_SHIP,
VEH_AIRCRAFT,
VEH_SPECIAL,
VEH_DISASTER,
+ VEH_END,
VEH_INVALID = 0xFF,
-} ;
+};
+template <> struct EnumPropsT<VehicleType> : MakeEnumPropsT<VehicleType, byte, VEH_TRAIN, VEH_END, VEH_INVALID> {};
+typedef TinyEnumT<VehicleType> VehicleTypeByte;
enum VehStatus {
VS_HIDDEN = 0x01,
@@ -203,7 +206,7 @@ struct VehicleShip {
struct Vehicle {
- byte type; // type, ie roadven,train,ship,aircraft,special
+ VehicleTypeByte type; ///< Type of vehicle
byte subtype; // subtype (Filled with values from EffectVehicles/TrainSubTypes/AircraftSubTypes)
VehicleID index; // NOSAVE: Index in vehicle array