diff options
author | rubidium <rubidium@openttd.org> | 2007-01-10 18:56:51 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-01-10 18:56:51 +0000 |
commit | f35ed4bbc2b05f1b83476b60948d64375f77f1b4 (patch) | |
tree | 1a1c59c13ddb1d152052f3a3a0bcffe4fb531173 /src/order.h | |
parent | a332d10fd938f345fff18e5f4a662a58f692f734 (diff) | |
download | openttd-f35ed4bbc2b05f1b83476b60948d64375f77f1b4.tar.xz |
(svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
Diffstat (limited to 'src/order.h')
-rw-r--r-- | src/order.h | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/order.h b/src/order.h index 7031f2455..ddc97481d 100644 --- a/src/order.h +++ b/src/order.h @@ -10,11 +10,13 @@ enum { INVALID_VEH_ORDER_ID = 0xFF, - INVALID_ORDER = 0xFFFF, }; +static const OrderID INVALID_ORDER = 0xFFFF; + /* Order types */ -enum OrderTypes { +enum OrderType { + OT_BEGIN = 0, OT_NOTHING = 0, OT_GOTO_STATION = 1, OT_GOTO_DEPOT = 2, @@ -22,9 +24,14 @@ enum OrderTypes { OT_LEAVESTATION = 4, OT_DUMMY = 5, OT_GOTO_WAYPOINT = 6, + OT_END }; + /* It needs to be 8bits, because we save and load it as such */ -typedef uint8 OrderType; +/** Define basic enum properties */ +template <> struct EnumPropsT<OrderType> : MakeEnumPropsT<OrderType, byte, OT_BEGIN, OT_END, OT_END> {}; +typedef TinyEnumT<OrderType> OrderTypeByte; + /* Order flags -- please use OFB instead OF and use HASBIT/SETBIT/CLEARBIT */ @@ -82,7 +89,7 @@ enum { * - REF_SHEDULE (all REFs are currently limited to 16 bits!!) */ typedef struct Order { - OrderType type; + OrderTypeByte type; uint8 flags; DestinationID dest; ///< The destionation of the order. |