equal
deleted
inserted
replaced
8 #include "macros.h" |
8 #include "macros.h" |
9 #include "oldpool.h" |
9 #include "oldpool.h" |
10 |
10 |
11 enum { |
11 enum { |
12 INVALID_VEH_ORDER_ID = 0xFF, |
12 INVALID_VEH_ORDER_ID = 0xFF, |
13 INVALID_ORDER = 0xFFFF, |
13 }; |
14 }; |
14 |
|
15 static const OrderID INVALID_ORDER = 0xFFFF; |
15 |
16 |
16 /* Order types */ |
17 /* Order types */ |
17 enum OrderTypes { |
18 enum OrderType { |
|
19 OT_BEGIN = 0, |
18 OT_NOTHING = 0, |
20 OT_NOTHING = 0, |
19 OT_GOTO_STATION = 1, |
21 OT_GOTO_STATION = 1, |
20 OT_GOTO_DEPOT = 2, |
22 OT_GOTO_DEPOT = 2, |
21 OT_LOADING = 3, |
23 OT_LOADING = 3, |
22 OT_LEAVESTATION = 4, |
24 OT_LEAVESTATION = 4, |
23 OT_DUMMY = 5, |
25 OT_DUMMY = 5, |
24 OT_GOTO_WAYPOINT = 6, |
26 OT_GOTO_WAYPOINT = 6, |
25 }; |
27 OT_END |
|
28 }; |
|
29 |
26 /* It needs to be 8bits, because we save and load it as such */ |
30 /* It needs to be 8bits, because we save and load it as such */ |
27 typedef uint8 OrderType; |
31 /** Define basic enum properties */ |
|
32 template <> struct EnumPropsT<OrderType> : MakeEnumPropsT<OrderType, byte, OT_BEGIN, OT_END, OT_END> {}; |
|
33 typedef TinyEnumT<OrderType> OrderTypeByte; |
|
34 |
28 |
35 |
29 /* Order flags -- please use OFB instead OF and use HASBIT/SETBIT/CLEARBIT */ |
36 /* Order flags -- please use OFB instead OF and use HASBIT/SETBIT/CLEARBIT */ |
30 |
37 |
31 /** Order flag masks - these are for direct bit operations */ |
38 /** Order flag masks - these are for direct bit operations */ |
32 enum OrderFlagMasks { |
39 enum OrderFlagMasks { |
80 * - Load_ORDR, all the global orders |
87 * - Load_ORDR, all the global orders |
81 * - Vehicle -> current_order |
88 * - Vehicle -> current_order |
82 * - REF_SHEDULE (all REFs are currently limited to 16 bits!!) |
89 * - REF_SHEDULE (all REFs are currently limited to 16 bits!!) |
83 */ |
90 */ |
84 typedef struct Order { |
91 typedef struct Order { |
85 OrderType type; |
92 OrderTypeByte type; |
86 uint8 flags; |
93 uint8 flags; |
87 DestinationID dest; ///< The destionation of the order. |
94 DestinationID dest; ///< The destionation of the order. |
88 |
95 |
89 struct Order *next; ///< Pointer to next order. If NULL, end of list |
96 struct Order *next; ///< Pointer to next order. If NULL, end of list |
90 |
97 |