OpenTTD
order_type.h
Go to the documentation of this file.
1 /* $Id$ */
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 uint32 OrderID;
19 typedef uint16 OrderListID;
20 typedef uint16 DestinationID;
21 
26 
28 static const OrderID INVALID_ORDER = 0xFFFFFF;
29 
34 static const uint IMPLICIT_ORDER_ONLY_CAP = 32;
35 
37 enum OrderType : byte {
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 
56  OUFB_UNLOAD = 1 << 0,
57  OUFB_TRANSFER = 1 << 1,
58  OUFB_NO_UNLOAD = 1 << 2,
59 };
60 
66  OLFB_FULL_LOAD = 1 << 1,
69 };
70 
79  ONSF_END
80 };
81 
89  OSL_END
90 };
91 
97  ODTFB_SERVICE = 1 << 0,
99 };
100 
106  ODATFB_HALT = 1 << 0,
108 };
110 
111 
123  OCV_END
124 };
125 
138  OCC_END
139 };
140 
141 
155  MOF_END
156 };
157 template <> struct EnumPropsT<ModifyOrderFlags> : MakeEnumPropsT<ModifyOrderFlags, byte, MOF_NON_STOP, MOF_END, MOF_END, 4> {};
158 
166  DA_END
167 };
168 
176  MTF_END
177 };
178 template <> struct EnumPropsT<ModifyTimetableFlags> : MakeEnumPropsT<ModifyTimetableFlags, byte, MTF_WAIT_TIME, MTF_END, MTF_END, 2> {};
179 
180 
183  CO_SHARE = 0,
184  CO_COPY = 1,
185  CO_UNSHARE = 2
186 };
187 
188 struct Order;
189 struct OrderList;
190 
191 #endif /* ORDER_TYPE_H */
OrderConditionVariable
Variables (of a vehicle) to &#39;cause&#39; skipping on.
Definition: order_type.h:114
Helper template class that makes basic properties of given enumeration type visible from outsize...
Definition: enum_type.hpp:64
DECLARE_ENUM_AS_BIT_SET(GenderEthnicity) enum CompanyManagerFaceVariable
Bitgroups of the CompanyManagerFace variable.
Set max travel speed.
Definition: order_type.h:175
Passes an OrderUnloadType.
Definition: order_type.h:148
Set wait time.
Definition: order_type.h:173
Skip if both values are equal.
Definition: order_type.h:130
Load as long as there is cargo that fits in the train.
Definition: order_type.h:65
static const VehicleOrderID INVALID_VEH_ORDER_ID
Invalid vehicle order index (sentinel)
Definition: order_type.h:23
Selects the OrderDepotAction.
Definition: order_type.h:150
Skip if the variable is true.
Definition: order_type.h:136
Skip based on the reliability.
Definition: order_type.h:116
Stop at the middle of the platform.
Definition: order_type.h:87
A comparator changes.
Definition: order_type.h:152
Unload all cargo that the station accepts.
Definition: order_type.h:55
Only service the vehicle.
Definition: order_type.h:105
OrderNonStopFlags
Non-stop order flags.
Definition: order_type.h:74
Skip if the value is more or equal to the limit.
Definition: order_type.h:135
ModifyTimetableFlags
Enumeration for the data to set in CmdChangeTimetable.
Definition: order_type.h:172
Skip based on the age.
Definition: order_type.h:118
Type (helpers) for enums.
The vehicle will stop at any station it passes except the destination.
Definition: order_type.h:77
Stop at the near end of the platform.
Definition: order_type.h:86
Set travel time.
Definition: order_type.h:174
Stop at the far end of the platform.
Definition: order_type.h:88
The vehicle will stop at any station it passes and the destination.
Definition: order_type.h:75
Passes an OrderStopLocation.
Definition: order_type.h:147
Shared order list linking together the linked list of orders and the list of vehicles sharing this or...
Definition: order_base.h:252
The vehicle will not stop at any stations it passes including the destination.
Definition: order_type.h:78
Do not load anything.
Definition: order_type.h:68
Manually initiated order.
Definition: order_type.h:96
Skip if the value is less or equal to the limit.
Definition: order_type.h:133
Change the destination of a conditional order.
Definition: order_type.h:154
Informative template class exposing basic enumeration properties used by several other templates belo...
Definition: enum_type.hpp:50
Always skip.
Definition: order_type.h:120
OrderDepotActionFlags
Actions that can be performed when the vehicle enters the depot.
Definition: order_type.h:104
OrderConditionComparator
Comparator for the skip reasoning.
Definition: order_type.h:129
Always go to the depot.
Definition: order_type.h:163
Service the vehicle and then halt it.
Definition: order_type.h:106
Service only if needed.
Definition: order_type.h:164
The value to set the condition to.
Definition: order_type.h:153
Skip based on the remaining lifetime.
Definition: order_type.h:121
Skip if the value is less than the limit.
Definition: order_type.h:132
Transfer all cargo onto the platform.
Definition: order_type.h:57
Skip when the vehicle requires service.
Definition: order_type.h:119
OrderUnloadFlags
Flags related to the unloading order.
Definition: order_type.h:54
A conditional variable changes.
Definition: order_type.h:151
OrderStopLocation
Where to stop the trains.
Definition: order_type.h:85
Passes an OrderNonStopFlags.
Definition: order_type.h:146
static const OrderID INVALID_ORDER
Invalid order (sentinel)
Definition: order_type.h:28
Skip if both values are not equal.
Definition: order_type.h:131
OrderLoadFlags
Flags related to the loading order.
Definition: order_type.h:64
OrderDepotAction
Depot action to switch to when doing a MOF_DEPOT_ACTION.
Definition: order_type.h:162
Send the vehicle to the nearest depot.
Definition: order_type.h:107
Full load all cargoes of the consist.
Definition: order_type.h:66
Skip based on the amount of load.
Definition: order_type.h:115
OrderType
Order types.
Definition: order_type.h:37
Totally no unloading will be done.
Definition: order_type.h:58
The vehicle will not stop at any stations it passes except the destination.
Definition: order_type.h:76
Skip based on the maximum speed.
Definition: order_type.h:117
Passes an OrderLoadType.
Definition: order_type.h:149
ModifyOrderFlags
Enumeration for the data to set in CmdModifyOrder.
Definition: order_type.h:145
byte VehicleOrderID
The index of an order within its current vehicle (not pool related)
Definition: order_type.h:17
Force unloading all cargo onto the platform, possibly not getting paid.
Definition: order_type.h:56
static const VehicleOrderID MAX_VEH_ORDER_ID
Last valid VehicleOrderID.
Definition: order_type.h:25
This depot order is because of a regular order.
Definition: order_type.h:98
Go to the depot and stop there.
Definition: order_type.h:165
Skip if the value is more than the limit.
Definition: order_type.h:134
Full load a single cargo of the consist.
Definition: order_type.h:67
This depot order is because of the servicing limit.
Definition: order_type.h:97
Skip if the variable is false.
Definition: order_type.h:137
Skip based on the maximum reliability.
Definition: order_type.h:122
CloneOptions
Clone actions.
Definition: order_type.h:182
static const uint IMPLICIT_ORDER_ONLY_CAP
Maximum number of orders in implicit-only lists before we start searching harder for duplicates...
Definition: order_type.h:34
OrderDepotTypeFlags
Reasons that could cause us to go to the depot.
Definition: order_type.h:95