Data Structures | Defines | Typedefs | Functions | Variables

# order_base.h File Reference

Base class for orders. More...

`#include "order_type.h"`
`#include "core/pool_type.hpp"`
`#include "core/bitmath_func.hpp"`
`#include "cargo_type.h"`
`#include "depot_type.h"`
`#include "station_type.h"`
`#include "vehicle_type.h"`
`#include "date_type.h"`

Go to the source code of this file.

## Data Structures
struct | Order
struct | OrderList
| Shared order list linking together the linked list of orders and the list of vehicles sharing this order list. More...
## Defines
#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)
#define | FOR_VEHICLE_ORDERS(v, order) for (order = (v->orders.list == NULL) ? NULL : v->orders.list->GetFirstOrder(); order != NULL; order = order->next)
#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)
## Typedefs
typedef Pool< Order, OrderID, 256, 64000 > | OrderPool
typedef Pool< OrderList, OrderListID, 128, 64000 > | OrderListPool
## Functions
void | InsertOrder (Vehicle *v, Order *new_o, VehicleOrderID sel_ord)
| Insert a new order but skip the validation.
void | DeleteOrder (Vehicle *v, VehicleOrderID sel_ord)
| Delete an order but skip the parameter validation.
## Variables
OrderPool | _order_pool
OrderListPool | _orderlist_pool

## Detailed Description

Base class for orders.

Definition in file order_base.h.

## Function Documentation

void DeleteOrder | ( | Vehicle * | v,
|  | VehicleOrderID | sel_ord |
| ) |  |  |

Delete an order but skip the parameter validation.

Parameters:

  | v | The vehicle to delete the order from.
  | sel_ord | The id of the order to be deleted.

Definition at line 1105 of file order_cmd.cpp.

References CancelLoadingDueToDeletedOrder(), Vehicle::cur_implicit_order_index, Vehicle::cur_real_order_index, Vehicle::current_order, OrderList::DeleteOrderAt(), DeleteOrderWarnings(), Vehicle::FirstShared(), Order::GetConditionSkipToOrder(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), GetWindowClassForVehicleType(), INVALID_VEH_ORDER_ID, InvalidateVehicleOrder(), InvalidateWindowClassesData(), Order::IsType(), Vehicle::list, max(), Vehicle::NextShared(), Vehicle::orders, Order::SetConditionSkipToOrder(), BaseVehicle::type, and Vehicle::UpdateRealOrderIndex().

Referenced by Vehicle::BeginLoading(), CmdDeleteOrder(), Vehicle::DeleteUnreachedImplicitOrders(), and RemoveOrderFromAllVehicles().

void InsertOrder | ( | Vehicle * | v,
|  | Order * | new_o,
|  | VehicleOrderID | sel_ord |
| ) |  |  |

Insert a new order but skip the validation.

Parameters:

  | v | The vehicle to insert the order to.
  | new_o | The new order.
  | sel_ord | The position the order should be inserted at.

Definition at line 976 of file order_cmd.cpp.

References Vehicle::cur_implicit_order_index, Vehicle::cur_real_order_index, DeleteOrderWarnings(), Vehicle::FirstShared(), Order::GetConditionSkipToOrder(), Vehicle::GetGroundVehicleFlags(), Vehicle::GetNumOrders(), GetWindowClassForVehicleType(), GVF_SUPPRESS_IMPLICIT_ORDERS, OrderList::InsertOrderAt(), INVALID_VEH_ORDER_ID, InvalidateVehicleOrder(), InvalidateWindowClassesData(), Vehicle::IsGroundVehicle(), Order::IsType(), Vehicle::list, Vehicle::NextShared(), Vehicle::orders, SetBit(), Order::SetConditionSkipToOrder(), and BaseVehicle::type.

Referenced by Vehicle::BeginLoading(), and CmdInsertOrder().