OpenTTD
order_type.h
Go to the documentation of this file.
1 /* $Id: order_type.h 25735 2013-08-20 20:05:31Z fonsinchen $ */
2 
3 /*
4  * This file is part of OpenTTD.
5  * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
6  * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
7  * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
8  */
9 
12 #ifndef ORDER_TYPE_H
13 #define ORDER_TYPE_H
14 
15 #include "core/enum_type.hpp"
16 
17 typedef byte VehicleOrderID;
18 typedef uint16 OrderID;
19 typedef uint16 OrderListID;
20 typedef uint16 DestinationID;
21 
26 
28 static const OrderID INVALID_ORDER = 0xFFFF;
29 
34 static const uint IMPLICIT_ORDER_ONLY_CAP = 32;
35 
37 enum OrderType {
38  OT_BEGIN = 0,
39  OT_NOTHING = 0,
40  OT_GOTO_STATION = 1,
41  OT_GOTO_DEPOT = 2,
42  OT_LOADING = 3,
43  OT_LEAVESTATION = 4,
44  OT_DUMMY = 5,
45  OT_GOTO_WAYPOINT = 6,
46  OT_CONDITIONAL = 7,
47  OT_IMPLICIT = 8,
48  OT_END
49 };
50 
53 
54 
60  OUFB_UNLOAD = 1 << 0,
61  OUFB_TRANSFER = 1 << 1,
62  OUFB_NO_UNLOAD = 1 << 2,
63 };
64 
70  OLFB_FULL_LOAD = 1 << 1,
73 };
74 
83  ONSF_END
84 };
85 
93  OSL_END
94 };
95 
101  ODTFB_SERVICE = 1 << 0,
103 };
104 
110  ODATFB_HALT = 1 << 0,
112 };
114 
115 
126  OCV_END
127 };
128 
141  OCC_END
142 };
143 
144 
158  MOF_END
159 };
160 template <> struct EnumPropsT<ModifyOrderFlags> : MakeEnumPropsT<ModifyOrderFlags, byte, MOF_NON_STOP, MOF_END, MOF_END, 4> {};
161 
169  DA_END
170 };
171 
179  MTF_END
180 };
181 template <> struct EnumPropsT<ModifyTimetableFlags> : MakeEnumPropsT<ModifyTimetableFlags, byte, MTF_WAIT_TIME, MTF_END, MTF_END, 2> {};
182 
183 
186  CO_SHARE = 0,
187  CO_COPY = 1,
188  CO_UNSHARE = 2
189 };
190 
191 struct Order;
192 struct OrderList;
193 
194 #endif /* ORDER_TYPE_H */