2008-03-28 17:36:32 +01:00
|
|
|
/* $Id$ */
|
|
|
|
|
|
|
|
/** @file order_type.h Types related to orders. */
|
|
|
|
|
|
|
|
#ifndef ORDER_TYPE_H
|
|
|
|
#define ORDER_TYPE_H
|
|
|
|
|
|
|
|
#include "core/enum_type.hpp"
|
|
|
|
|
|
|
|
typedef byte VehicleOrderID; ///< The index of an order within its current vehicle (not pool related)
|
|
|
|
typedef uint16 OrderID;
|
2008-03-28 17:45:20 +01:00
|
|
|
typedef uint16 DestinationID;
|
2008-03-28 17:36:32 +01:00
|
|
|
|
|
|
|
enum {
|
|
|
|
INVALID_VEH_ORDER_ID = 0xFF,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const OrderID INVALID_ORDER = 0xFFFF;
|
|
|
|
|
|
|
|
/* Order types */
|
|
|
|
enum OrderType {
|
|
|
|
OT_BEGIN = 0,
|
|
|
|
OT_NOTHING = 0,
|
|
|
|
OT_GOTO_STATION = 1,
|
|
|
|
OT_GOTO_DEPOT = 2,
|
|
|
|
OT_LOADING = 3,
|
|
|
|
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 */
|
|
|
|
/** Define basic enum properties */
|
|
|
|
template <> struct EnumPropsT<OrderType> : MakeEnumPropsT<OrderType, byte, OT_BEGIN, OT_END, OT_END> {};
|
|
|
|
typedef TinyEnumT<OrderType> OrderTypeByte;
|
|
|
|
|
|
|
|
|
2008-04-07 22:03:46 +02:00
|
|
|
/**
|
|
|
|
* Flags related to the unloading order.
|
|
|
|
*/
|
|
|
|
enum OrderUnloadFlags {
|
|
|
|
OUF_UNLOAD_IF_POSSIBLE = 0, ///< Unload all cargo that the station accepts.
|
|
|
|
OUFB_TRANSFER = 1 << 0, ///< Transfer all cargo onto the platform.
|
|
|
|
OUFB_UNLOAD = 1 << 1, ///< Force unloading all cargo onto the platform, possibly not getting paid.
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Flags related to the loading order.
|
|
|
|
*/
|
|
|
|
enum OrderLoadFlags {
|
|
|
|
OLF_LOAD_IF_POSSIBLE = 0, ///< Load as long as there is cargo that fits in the train.
|
|
|
|
OLFB_FULL_LOAD = 1 << 2, ///< Full load the complete (or a single cargo) of the consist.
|
2008-04-07 10:59:04 +02:00
|
|
|
};
|
2008-03-28 17:36:32 +01:00
|
|
|
|
2008-04-07 10:59:04 +02:00
|
|
|
/**
|
|
|
|
* Non-stop order flags.
|
|
|
|
*/
|
|
|
|
enum OrderNonStopFlags {
|
2008-04-07 22:03:46 +02:00
|
|
|
ONSF_STOP_EVERYWHERE = 0, ///< The vehicle will stop at any station it passes and the destination.
|
|
|
|
ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS = 1, ///< The vehicle will not stop at any stations it passes except the destination.
|
|
|
|
ONSF_NO_STOP_AT_DESTINATION_STATION = 2, ///< The vehicle will stop at any station it passes except the destination.
|
|
|
|
ONSF_NO_STOP_AT_ANY_STATION = 3, ///< The vehicle will not stop at any stations it passes including the destination.
|
2008-03-28 17:36:32 +01:00
|
|
|
};
|
|
|
|
|
2008-04-07 21:18:56 +02:00
|
|
|
/**
|
|
|
|
* Reasons that could cause us to go to the depot.
|
|
|
|
*/
|
|
|
|
enum OrderDepotTypeFlags {
|
|
|
|
ODTF_MANUAL = 0, ///< The player initiated this order manually.
|
|
|
|
ODTFB_SERVICE = 1 << 2, ///< This depot order is because of the servicing limit.
|
|
|
|
ODTFB_PART_OF_ORDERS = 1 << 1, ///< This depot order is because of a regular order.
|
|
|
|
};
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Actions that can be performed when the vehicle enters the depot.
|
|
|
|
*/
|
|
|
|
enum OrderDepotActionFlags {
|
|
|
|
ODATF_SERVICE_ONLY = 0, ///< Only service the vehicle.
|
|
|
|
ODATFB_HALT = 1 << 2, ///< Service the vehicle and then halt it.
|
|
|
|
};
|
|
|
|
|
2008-04-07 22:03:46 +02:00
|
|
|
/**
|
|
|
|
* Enumeration for the 'flag' to toggle in CmdModifyOrder.
|
2008-03-28 17:36:32 +01:00
|
|
|
*/
|
|
|
|
enum {
|
|
|
|
OF_TRANSFER = 0,
|
|
|
|
OF_UNLOAD = 1,
|
|
|
|
OF_FULL_LOAD = 2,
|
|
|
|
OF_NON_STOP = 3
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Possible clone options */
|
|
|
|
enum {
|
|
|
|
CO_SHARE = 0,
|
|
|
|
CO_COPY = 1,
|
|
|
|
CO_UNSHARE = 2
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Order;
|
|
|
|
|
|
|
|
#endif /* ORDER_TYPE_H */
|