# order_type.h

Go to the documentation of this file.

    00001 /* $Id: order_type.h 14830 2009-01-04 15:53:43Z rubidium $ */
    00002
    00005 #ifndef ORDER_TYPE_H
    00006 #define ORDER_TYPE_H
    00007
    00008 #include "core/enum_type.hpp"
    00009
    00010 typedef byte VehicleOrderID;
    00011 typedef uint16 OrderID;
    00012 typedef uint16 OrderListID;
    00013 typedef uint16 DestinationID;
    00014
    00016 static const VehicleOrderID INVALID_VEH_ORDER_ID = 0xFF;
    00018 static const VehicleOrderID MAX_VEH_ORDER_ID     = INVALID_VEH_ORDER_ID - 1;
    00019
    00021 static const OrderID INVALID_ORDER = 0xFFFF;
    00022
    00023 /* Order types */
    00024 enum OrderType {
    00025   OT_BEGIN         = 0,
    00026   OT_NOTHING       = 0,
    00027   OT_GOTO_STATION  = 1,
    00028   OT_GOTO_DEPOT    = 2,
    00029   OT_LOADING       = 3,
    00030   OT_LEAVESTATION  = 4,
    00031   OT_DUMMY         = 5,
    00032   OT_GOTO_WAYPOINT = 6,
    00033   OT_CONDITIONAL   = 7,
    00034   OT_END
    00035 };
    00036
    00037 /* It needs to be 8bits, because we save and load it as such */
    00039 template <> struct EnumPropsT<OrderType> : MakeEnumPropsT<OrderType, byte, OT_BEGIN, OT_END, OT_END> {};
    00040 typedef TinyEnumT<OrderType> OrderTypeByte;
    00041
    00042
    00046 enum OrderUnloadFlags {
    00047   OUF_UNLOAD_IF_POSSIBLE = 0,
    00048   OUFB_UNLOAD            = 1 << 0,
    00049   OUFB_TRANSFER          = 1 << 1,
    00050   OUFB_NO_UNLOAD         = 1 << 2,
    00051 };
    00052
    00056 enum OrderLoadFlags {
    00057   OLF_LOAD_IF_POSSIBLE = 0,
    00058   OLFB_FULL_LOAD       = 1 << 1,
    00059   OLF_FULL_LOAD_ANY    = 3,
    00060   OLFB_NO_LOAD         = 4,
    00061 };
    00062
    00066 enum OrderNonStopFlags {
    00067   ONSF_STOP_EVERYWHERE                  = 0,
    00068   ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS = 1,
    00069   ONSF_NO_STOP_AT_DESTINATION_STATION   = 2,
    00070   ONSF_NO_STOP_AT_ANY_STATION           = 3,
    00071   ONSF_END
    00072 };
    00073
    00077 enum OrderDepotTypeFlags {
    00078   ODTF_MANUAL          = 0,
    00079   ODTFB_SERVICE        = 1 << 0,
    00080   ODTFB_PART_OF_ORDERS = 1 << 1,
    00081 };
    00082
    00086 enum OrderDepotActionFlags {
    00087   ODATF_SERVICE_ONLY   = 0,
    00088   ODATFB_HALT          = 1 << 0,
    00089   ODATFB_NEAREST_DEPOT = 1 << 1,
    00090 };
    00091
    00095 enum OrderConditionVariable {
    00096   OCV_LOAD_PERCENTAGE,
    00097   OCV_RELIABILITY,
    00098   OCV_MAX_SPEED,
    00099   OCV_AGE,
    00100   OCV_REQUIRES_SERVICE,
    00101   OCV_UNCONDITIONALLY,
    00102   OCV_END
    00103 };
    00104
    00108 enum OrderConditionComparator {
    00109   OCC_EQUALS,
    00110   OCC_NOT_EQUALS,
    00111   OCC_LESS_THAN,
    00112   OCC_LESS_EQUALS,
    00113   OCC_MORE_THAN,
    00114   OCC_MORE_EQUALS,
    00115   OCC_IS_TRUE,
    00116   OCC_IS_FALSE,
    00117   OCC_END
    00118 };
    00119
    00120
    00124 enum ModifyOrderFlags {
    00125   MOF_NON_STOP,
    00126   MOF_UNLOAD,
    00127   MOF_LOAD,
    00128   MOF_DEPOT_ACTION,
    00129   MOF_COND_VARIABLE,
    00130   MOF_COND_COMPARATOR,
    00131   MOF_COND_VALUE,
    00132   MOF_COND_DESTINATION,
    00133   MOF_END
    00134 };
    00135
    00139 enum OrderDepotAction {
    00140   DA_ALWAYS_GO,
    00141   DA_SERVICE,
    00142   DA_STOP,
    00143   DA_END
    00144 };
    00145
    00146
    00147 /* Possible clone options */
    00148 enum {
    00149   CO_SHARE   = 0,
    00150   CO_COPY    = 1,
    00151   CO_UNSHARE = 2
    00152 };
    00153
    00154 struct Order;
    00155 struct OrderList;
    00156
    00157 #endif /* ORDER_TYPE_H */