2005-07-24 14:12:37 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
2009-08-21 20:21:05 +00:00
|
|
|
/*
|
|
|
|
* This file is part of OpenTTD.
|
|
|
|
* 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.
|
|
|
|
* 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.
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2008-05-06 15:11:33 +00:00
|
|
|
/** @file order_base.h Base class for orders. */
|
2005-07-28 06:09:15 +00:00
|
|
|
|
2008-03-30 23:24:18 +00:00
|
|
|
#ifndef ORDER_BASE_H
|
|
|
|
#define ORDER_BASE_H
|
2005-01-15 19:06:22 +00:00
|
|
|
|
2008-03-28 16:36:32 +00:00
|
|
|
#include "order_type.h"
|
2009-05-22 15:39:22 +00:00
|
|
|
#include "core/pool_type.hpp"
|
2007-12-21 19:21:21 +00:00
|
|
|
#include "core/bitmath_func.hpp"
|
2007-12-21 22:50:51 +00:00
|
|
|
#include "cargo_type.h"
|
2008-04-05 23:36:54 +00:00
|
|
|
#include "depot_type.h"
|
2008-04-05 15:30:15 +00:00
|
|
|
#include "station_type.h"
|
|
|
|
#include "vehicle_type.h"
|
2009-11-21 12:43:09 +00:00
|
|
|
#include "date_type.h"
|
2005-02-06 10:24:57 +00:00
|
|
|
|
2009-05-22 15:13:50 +00:00
|
|
|
typedef Pool<Order, OrderID, 256, 64000> OrderPool;
|
|
|
|
typedef Pool<OrderList, OrderListID, 128, 64000> OrderListPool;
|
|
|
|
extern OrderPool _order_pool;
|
|
|
|
extern OrderListPool _orderlist_pool;
|
2007-08-02 23:40:19 +00:00
|
|
|
|
2005-01-15 19:06:22 +00:00
|
|
|
/* If you change this, keep in mind that it is saved on 3 places:
|
2006-06-27 21:25:53 +00:00
|
|
|
* - Load_ORDR, all the global orders
|
|
|
|
* - Vehicle -> current_order
|
2007-06-20 19:17:22 +00:00
|
|
|
* - REF_ORDER (all REFs are currently limited to 16 bits!!)
|
2006-06-27 21:25:53 +00:00
|
|
|
*/
|
2009-05-22 15:13:50 +00:00
|
|
|
struct Order : OrderPool::PoolItem<&_order_pool> {
|
2008-04-05 23:36:54 +00:00
|
|
|
private:
|
|
|
|
friend const struct SaveLoad *GetVehicleDescription(VehicleType vt); ///< Saving and loading the current order of vehicles.
|
|
|
|
friend void Load_VEHS(); ///< Loading of ancient vehicles.
|
|
|
|
friend const struct SaveLoad *GetOrderDescription(); ///< Saving and loading of orders.
|
2007-02-04 13:46:21 +00:00
|
|
|
|
2008-04-10 08:30:15 +00:00
|
|
|
uint8 type; ///< The type of order + non-stop flags
|
|
|
|
uint8 flags; ///< Load/unload types, depot order/action types.
|
2008-04-06 07:48:51 +00:00
|
|
|
DestinationID dest; ///< The destination of the order.
|
2008-04-06 07:07:21 +00:00
|
|
|
|
|
|
|
CargoID refit_cargo; ///< Refit CargoID
|
2008-04-05 23:36:54 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
Order *next; ///< Pointer to next order. If NULL, end of list
|
|
|
|
|
2007-06-20 19:17:22 +00:00
|
|
|
uint16 wait_time; ///< How long in ticks to wait at the destination.
|
|
|
|
uint16 travel_time; ///< How long in ticks the journey to this destination should take.
|
2012-02-14 17:04:06 +00:00
|
|
|
uint16 max_speed; ///< How fast the vehicle may go on the way to the destination.
|
2007-06-20 19:17:22 +00:00
|
|
|
|
2012-02-14 17:04:06 +00:00
|
|
|
Order() : refit_cargo(CT_NO_REFIT), max_speed(UINT16_MAX) {}
|
2011-11-12 18:06:34 +00:00
|
|
|
~Order();
|
2007-08-02 23:40:19 +00:00
|
|
|
|
2008-04-06 07:22:26 +00:00
|
|
|
Order(uint32 packed);
|
|
|
|
|
2008-04-05 23:36:54 +00:00
|
|
|
/**
|
|
|
|
* Check whether this order is of the given type.
|
|
|
|
* @param type the type to check against.
|
|
|
|
* @return true if the order matches.
|
|
|
|
*/
|
2008-04-10 08:30:15 +00:00
|
|
|
inline bool IsType(OrderType type) const { return this->GetType() == type; }
|
2008-04-05 23:36:54 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the type of order of this order.
|
|
|
|
* @return the order type.
|
|
|
|
*/
|
2008-04-12 11:58:19 +00:00
|
|
|
inline OrderType GetType() const { return (OrderType)GB(this->type, 0, 4); }
|
2008-04-05 23:36:54 +00:00
|
|
|
|
2007-03-08 21:39:34 +00:00
|
|
|
void Free();
|
2008-04-05 20:57:01 +00:00
|
|
|
|
2008-04-05 23:36:54 +00:00
|
|
|
void MakeGoToStation(StationID destination);
|
2013-02-24 16:41:51 +00:00
|
|
|
void MakeGoToDepot(DepotID destination, OrderDepotTypeFlags order, OrderNonStopFlags non_stop_type = ONSF_NO_STOP_AT_INTERMEDIATE_STATIONS, OrderDepotActionFlags action = ODATF_SERVICE_ONLY, CargoID cargo = CT_NO_REFIT);
|
2009-07-28 21:06:38 +00:00
|
|
|
void MakeGoToWaypoint(StationID destination);
|
2008-04-06 15:09:45 +00:00
|
|
|
void MakeLoading(bool ordered);
|
2008-04-05 23:36:54 +00:00
|
|
|
void MakeLeaveStation();
|
|
|
|
void MakeDummy();
|
2008-04-12 11:58:19 +00:00
|
|
|
void MakeConditional(VehicleOrderID order);
|
2011-05-18 12:19:58 +00:00
|
|
|
void MakeImplicit(StationID destination);
|
2010-12-26 09:03:19 +00:00
|
|
|
|
2011-12-13 00:43:48 +00:00
|
|
|
/**
|
|
|
|
* Is this a 'goto' order with a real destination?
|
2011-12-13 00:54:13 +00:00
|
|
|
* @return True if the type is either #OT_GOTO_WAYPOINT, #OT_GOTO_DEPOT or #OT_GOTO_STATION.
|
2011-12-13 00:43:48 +00:00
|
|
|
*/
|
|
|
|
inline bool IsGotoOrder() const
|
|
|
|
{
|
|
|
|
return IsType(OT_GOTO_WAYPOINT) || IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION);
|
|
|
|
}
|
|
|
|
|
2008-04-06 07:48:51 +00:00
|
|
|
/**
|
|
|
|
* Gets the destination of this order.
|
|
|
|
* @pre IsType(OT_GOTO_WAYPOINT) || IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION).
|
|
|
|
* @return the destination of the order.
|
|
|
|
*/
|
|
|
|
inline DestinationID GetDestination() const { return this->dest; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Sets the destination of this order.
|
|
|
|
* @param destination the new destination of the order.
|
|
|
|
* @pre IsType(OT_GOTO_WAYPOINT) || IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION).
|
|
|
|
*/
|
|
|
|
inline void SetDestination(DestinationID destination) { this->dest = destination; }
|
|
|
|
|
2008-04-06 07:07:21 +00:00
|
|
|
/**
|
|
|
|
* Is this order a refit order.
|
2011-11-04 00:38:51 +00:00
|
|
|
* @pre IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION)
|
2008-04-06 07:07:21 +00:00
|
|
|
* @return true if a refit should happen.
|
|
|
|
*/
|
2011-11-04 00:38:51 +00:00
|
|
|
inline bool IsRefit() const { return this->refit_cargo < NUM_CARGO || this->refit_cargo == CT_AUTO_REFIT; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is this order a auto-refit order.
|
|
|
|
* @pre IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION)
|
|
|
|
* @return true if a auto-refit should happen.
|
|
|
|
*/
|
|
|
|
inline bool IsAutoRefit() const { return this->refit_cargo == CT_AUTO_REFIT; }
|
2008-04-06 07:07:21 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the cargo to to refit to.
|
2011-11-04 00:38:51 +00:00
|
|
|
* @pre IsType(OT_GOTO_DEPOT) || IsType(OT_GOTO_STATION)
|
2008-04-06 07:07:21 +00:00
|
|
|
* @return the cargo type.
|
|
|
|
*/
|
|
|
|
inline CargoID GetRefitCargo() const { return this->refit_cargo; }
|
|
|
|
|
2013-02-24 16:41:51 +00:00
|
|
|
void SetRefit(CargoID cargo);
|
2008-04-06 07:07:21 +00:00
|
|
|
|
2008-04-06 15:09:45 +00:00
|
|
|
/** How must the consist be loaded? */
|
2008-04-10 08:30:15 +00:00
|
|
|
inline OrderLoadFlags GetLoadType() const { return (OrderLoadFlags)GB(this->flags, 4, 4); }
|
2008-04-06 15:09:45 +00:00
|
|
|
/** How must the consist be unloaded? */
|
2008-04-10 08:30:15 +00:00
|
|
|
inline OrderUnloadFlags GetUnloadType() const { return (OrderUnloadFlags)GB(this->flags, 0, 4); }
|
2009-04-12 14:11:14 +00:00
|
|
|
/** At which stations must we stop? */
|
2008-04-10 08:30:15 +00:00
|
|
|
inline OrderNonStopFlags GetNonStopType() const { return (OrderNonStopFlags)GB(this->type, 6, 2); }
|
2009-04-12 14:11:14 +00:00
|
|
|
/** Where must we stop at the platform? */
|
|
|
|
inline OrderStopLocation GetStopLocation() const { return (OrderStopLocation)GB(this->type, 4, 2); }
|
2008-04-06 15:09:45 +00:00
|
|
|
/** What caused us going to the depot? */
|
2008-04-10 08:30:15 +00:00
|
|
|
inline OrderDepotTypeFlags GetDepotOrderType() const { return (OrderDepotTypeFlags)GB(this->flags, 0, 4); }
|
2008-04-06 15:09:45 +00:00
|
|
|
/** What are we going to do when in the depot. */
|
2008-04-10 08:30:15 +00:00
|
|
|
inline OrderDepotActionFlags GetDepotActionType() const { return (OrderDepotActionFlags)GB(this->flags, 4, 4); }
|
2008-04-12 11:58:19 +00:00
|
|
|
/** What variable do we have to compare? */
|
|
|
|
inline OrderConditionVariable GetConditionVariable() const { return (OrderConditionVariable)GB(this->dest, 11, 5); }
|
|
|
|
/** What is the comparator to use? */
|
|
|
|
inline OrderConditionComparator GetConditionComparator() const { return (OrderConditionComparator)GB(this->type, 5, 3); }
|
|
|
|
/** Get the order to skip to. */
|
|
|
|
inline VehicleOrderID GetConditionSkipToOrder() const { return this->flags; }
|
|
|
|
/** Get the value to base the skip on. */
|
|
|
|
inline uint16 GetConditionValue() const { return GB(this->dest, 0, 11); }
|
2008-04-06 15:09:45 +00:00
|
|
|
|
|
|
|
/** Set how the consist must be loaded. */
|
2008-04-10 08:30:15 +00:00
|
|
|
inline void SetLoadType(OrderLoadFlags load_type) { SB(this->flags, 4, 4, load_type); }
|
2008-04-06 15:09:45 +00:00
|
|
|
/** Set how the consist must be unloaded. */
|
2008-04-10 08:30:15 +00:00
|
|
|
inline void SetUnloadType(OrderUnloadFlags unload_type) { SB(this->flags, 0, 4, unload_type); }
|
2008-04-06 15:09:45 +00:00
|
|
|
/** Set whether we must stop at stations or not. */
|
2008-04-10 08:30:15 +00:00
|
|
|
inline void SetNonStopType(OrderNonStopFlags non_stop_type) { SB(this->type, 6, 2, non_stop_type); }
|
2009-04-12 14:11:14 +00:00
|
|
|
/** Set where we must stop at the platform. */
|
|
|
|
inline void SetStopLocation(OrderStopLocation stop_location) { SB(this->type, 4, 2, stop_location); }
|
2008-04-06 15:09:45 +00:00
|
|
|
/** Set the cause to go to the depot. */
|
2008-04-10 08:30:15 +00:00
|
|
|
inline void SetDepotOrderType(OrderDepotTypeFlags depot_order_type) { SB(this->flags, 0, 4, depot_order_type); }
|
2008-04-06 15:09:45 +00:00
|
|
|
/** Set what we are going to do in the depot. */
|
2008-04-12 11:58:19 +00:00
|
|
|
inline void SetDepotActionType(OrderDepotActionFlags depot_service_type) { SB(this->flags, 4, 4, depot_service_type); }
|
|
|
|
/** Set variable we have to compare. */
|
|
|
|
inline void SetConditionVariable(OrderConditionVariable condition_variable) { SB(this->dest, 11, 5, condition_variable); }
|
|
|
|
/** Set the comparator to use. */
|
|
|
|
inline void SetConditionComparator(OrderConditionComparator condition_comparator) { SB(this->type, 5, 3, condition_comparator); }
|
|
|
|
/** Get the order to skip to. */
|
|
|
|
inline void SetConditionSkipToOrder(VehicleOrderID order_id) { this->flags = order_id; }
|
|
|
|
/** Set the value to base the skip on. */
|
|
|
|
inline void SetConditionValue(uint16 value) { SB(this->dest, 0, 11, value); }
|
2008-04-06 15:09:45 +00:00
|
|
|
|
2008-04-05 15:30:15 +00:00
|
|
|
bool ShouldStopAtStation(const Vehicle *v, StationID station) const;
|
2011-12-13 00:43:35 +00:00
|
|
|
TileIndex GetLocation(const Vehicle *v, bool airport = false) const;
|
2008-04-05 21:45:05 +00:00
|
|
|
|
2009-01-03 13:52:06 +00:00
|
|
|
/** Checks if this order has travel_time and if needed wait_time set. */
|
|
|
|
inline bool IsCompletelyTimetabled() const
|
|
|
|
{
|
|
|
|
if (this->travel_time == 0 && !this->IsType(OT_CONDITIONAL)) return false;
|
|
|
|
if (this->wait_time == 0 && this->IsType(OT_GOTO_STATION) && !(this->GetNonStopType() & ONSF_NO_STOP_AT_DESTINATION_STATION)) return false;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2008-04-05 21:45:05 +00:00
|
|
|
void AssignOrder(const Order &other);
|
|
|
|
bool Equals(const Order &other) const;
|
2008-04-06 07:22:26 +00:00
|
|
|
|
|
|
|
uint32 Pack() const;
|
2009-06-21 10:11:04 +00:00
|
|
|
uint16 MapOldOrder() const;
|
2008-04-10 08:30:15 +00:00
|
|
|
void ConvertFromOldSavegame();
|
2007-03-07 12:11:48 +00:00
|
|
|
};
|
2005-01-15 19:06:22 +00:00
|
|
|
|
2010-12-22 21:16:34 +00:00
|
|
|
void InsertOrder(Vehicle *v, Order *new_o, VehicleOrderID sel_ord);
|
|
|
|
void DeleteOrder(Vehicle *v, VehicleOrderID sel_ord);
|
|
|
|
|
2010-08-01 19:22:34 +00:00
|
|
|
/**
|
|
|
|
* Shared order list linking together the linked list of orders and the list
|
2009-01-03 13:52:06 +00:00
|
|
|
* of vehicles sharing this order list.
|
|
|
|
*/
|
2009-05-22 15:13:50 +00:00
|
|
|
struct OrderList : OrderListPool::PoolItem<&_orderlist_pool> {
|
2009-01-03 13:52:06 +00:00
|
|
|
private:
|
|
|
|
friend void AfterLoadVehicles(bool part_of_load); ///< For instantiating the shared vehicle chain
|
|
|
|
friend const struct SaveLoad *GetOrderListDescription(); ///< Saving and loading of order lists.
|
|
|
|
|
2010-12-26 13:25:34 +00:00
|
|
|
Order *first; ///< First order of the order list.
|
|
|
|
VehicleOrderID num_orders; ///< NOSAVE: How many orders there are in the list.
|
|
|
|
VehicleOrderID num_manual_orders; ///< NOSAVE: How many manually added orders are there in the list.
|
|
|
|
uint num_vehicles; ///< NOSAVE: Number of vehicles that share this order list.
|
|
|
|
Vehicle *first_shared; ///< NOSAVE: pointer to the first vehicle in the shared order chain.
|
2009-01-03 13:52:06 +00:00
|
|
|
|
2010-12-26 13:25:34 +00:00
|
|
|
Ticks timetable_duration; ///< NOSAVE: Total duration of the order list
|
2009-01-03 13:52:06 +00:00
|
|
|
|
|
|
|
public:
|
|
|
|
/** Default constructor producing an invalid order list. */
|
2009-05-17 16:28:29 +00:00
|
|
|
OrderList(VehicleOrderID num_orders = INVALID_VEH_ORDER_ID)
|
2010-12-26 13:25:34 +00:00
|
|
|
: first(NULL), num_orders(num_orders), num_manual_orders(0), num_vehicles(0), first_shared(NULL),
|
2009-01-03 13:52:06 +00:00
|
|
|
timetable_duration(0) { }
|
|
|
|
|
2010-08-01 19:22:34 +00:00
|
|
|
/**
|
|
|
|
* Create an order list with the given order chain for the given vehicle.
|
2009-05-22 15:13:50 +00:00
|
|
|
* @param chain pointer to the first order of the order chain
|
|
|
|
* @param v any vehicle using this orderlist
|
2009-01-03 13:52:06 +00:00
|
|
|
*/
|
2009-05-22 15:13:50 +00:00
|
|
|
OrderList(Order *chain, Vehicle *v) { this->Initialize(chain, v); }
|
2009-01-03 13:52:06 +00:00
|
|
|
|
|
|
|
/** Destructor. Invalidates OrderList for re-usage by the pool. */
|
2009-05-22 15:13:50 +00:00
|
|
|
~OrderList() {}
|
2009-01-03 13:52:06 +00:00
|
|
|
|
2009-05-22 15:13:50 +00:00
|
|
|
void Initialize(Order *chain, Vehicle *v);
|
2009-01-03 13:52:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the first order of the order chain.
|
|
|
|
* @return the first order of the chain.
|
|
|
|
*/
|
|
|
|
inline Order *GetFirstOrder() const { return this->first; }
|
|
|
|
|
|
|
|
Order *GetOrderAt(int index) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the last order of the order chain.
|
|
|
|
* @return the last order of the chain.
|
|
|
|
*/
|
|
|
|
inline Order *GetLastOrder() const { return this->GetOrderAt(this->num_orders - 1); }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get number of orders in the order list.
|
2010-08-01 19:44:49 +00:00
|
|
|
* @return number of orders in the chain.
|
|
|
|
*/
|
2009-01-03 13:52:06 +00:00
|
|
|
inline VehicleOrderID GetNumOrders() const { return this->num_orders; }
|
|
|
|
|
2010-12-26 13:25:34 +00:00
|
|
|
/**
|
|
|
|
* Get number of manually added orders in the order list.
|
|
|
|
* @return number of manual orders in the chain.
|
|
|
|
*/
|
|
|
|
inline VehicleOrderID GetNumManualOrders() const { return this->num_manual_orders; }
|
|
|
|
|
2009-01-03 13:52:06 +00:00
|
|
|
void InsertOrderAt(Order *new_order, int index);
|
|
|
|
void DeleteOrderAt(int index);
|
|
|
|
void MoveOrder(int from, int to);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Is this a shared order list?
|
|
|
|
* @return whether this order list is shared among multiple vehicles
|
|
|
|
*/
|
|
|
|
inline bool IsShared() const { return this->num_vehicles > 1; };
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get the first vehicle of this vehicle chain.
|
|
|
|
* @return the first vehicle of the chain.
|
|
|
|
*/
|
|
|
|
inline Vehicle *GetFirstSharedVehicle() const { return this->first_shared; }
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Return the number of vehicles that share this orders list
|
|
|
|
* @return the count of vehicles that use this shared orders list
|
|
|
|
*/
|
2009-01-03 17:28:22 +00:00
|
|
|
inline uint GetNumVehicles() const { return this->num_vehicles; }
|
2009-01-03 13:52:06 +00:00
|
|
|
|
|
|
|
bool IsVehicleInSharedOrdersList(const Vehicle *v) const;
|
|
|
|
int GetPositionInSharedOrderList(const Vehicle *v) const;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Adds the given vehicle to this shared order list.
|
|
|
|
* @note This is supposed to be called after the vehicle has been inserted
|
|
|
|
* into the shared vehicle chain.
|
|
|
|
* @param v vehicle to add to the list
|
|
|
|
*/
|
|
|
|
inline void AddVehicle(Vehicle *v) { ++this->num_vehicles; }
|
|
|
|
|
|
|
|
void RemoveVehicle(Vehicle *v);
|
|
|
|
|
|
|
|
bool IsCompleteTimetable() const;
|
|
|
|
|
|
|
|
/**
|
2009-11-21 12:43:09 +00:00
|
|
|
* Gets the total duration of the vehicles timetable or INVALID_TICKS is the timetable is not complete.
|
|
|
|
* @return total timetable duration or INVALID_TICKS for incomplete timetables
|
2009-01-03 13:52:06 +00:00
|
|
|
*/
|
2009-11-21 12:43:09 +00:00
|
|
|
inline Ticks GetTimetableTotalDuration() const { return this->IsCompleteTimetable() ? this->timetable_duration : INVALID_TICKS; }
|
2009-01-03 13:52:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets the known duration of the vehicles timetable even if the timetable is not complete.
|
|
|
|
* @return known timetable duration
|
|
|
|
*/
|
2009-11-21 12:43:09 +00:00
|
|
|
inline Ticks GetTimetableDurationIncomplete() const { return this->timetable_duration; }
|
2009-01-03 13:52:06 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Must be called if an order's timetable is changed to update internal book keeping.
|
|
|
|
* @param delta By how many ticks has the timetable duration changed
|
|
|
|
*/
|
2009-11-21 12:43:09 +00:00
|
|
|
void UpdateOrderTimetable(Ticks delta) { this->timetable_duration += delta; }
|
2009-01-03 13:52:06 +00:00
|
|
|
|
|
|
|
void FreeChain(bool keep_orderlist = false);
|
|
|
|
|
|
|
|
void DebugCheckSanity() const;
|
|
|
|
};
|
|
|
|
|
2009-05-22 14:23:36 +00:00
|
|
|
#define FOR_ALL_ORDERS_FROM(var, start) FOR_ALL_ITEMS_FROM(Order, order_index, var, start)
|
|
|
|
#define FOR_ALL_ORDERS(var) FOR_ALL_ORDERS_FROM(var, 0)
|
2005-02-06 10:24:57 +00:00
|
|
|
|
2005-01-15 19:06:22 +00:00
|
|
|
|
2009-01-03 13:52:06 +00:00
|
|
|
#define FOR_VEHICLE_ORDERS(v, order) for (order = (v->orders.list == NULL) ? NULL : v->orders.list->GetFirstOrder(); order != NULL; order = order->next)
|
|
|
|
|
|
|
|
|
2009-05-22 14:23:36 +00:00
|
|
|
#define FOR_ALL_ORDER_LISTS_FROM(var, start) FOR_ALL_ITEMS_FROM(OrderList, orderlist_index, var, start)
|
|
|
|
#define FOR_ALL_ORDER_LISTS(var) FOR_ALL_ORDER_LISTS_FROM(var, 0)
|
2005-01-15 19:06:22 +00:00
|
|
|
|
2010-12-22 10:50:32 +00:00
|
|
|
#endif /* ORDER_BASE_H */
|