OpenTTD Source 20260206-master-g4d4e37dbf1
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 "timer/timer_game_tick.h"
#include "saveload/saveload.h"

Go to the source code of this file.

Data Structures

struct  Order
struct  OldOrderSaveLoadItem
 Compatibility struct to allow saveload of pool-based orders. More...
struct  OrderList
 Shared order list linking together the linked list of orders and the list of vehicles sharing this order list. More...

Typedefs

using OrderListPool = Pool<OrderList, OrderListID, 128>

Functions

OldOrderSaveLoadItemGetOldOrder (size_t pool_index)
 Get a pointer to an old order with the given reference index.
OldOrderSaveLoadItemAllocateOldOrder (size_t pool_index)
 Allocate an old order with the given pool index.
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

OrderListPool _orderlist_pool

Detailed Description

Base class for orders.

Definition in file order_base.h.

Typedef Documentation

◆ OrderListPool

using OrderListPool = Pool<OrderList, OrderListID, 128>

Definition at line 23 of file order_base.h.

Function Documentation

◆ AllocateOldOrder()

OldOrderSaveLoadItem & AllocateOldOrder ( size_t pool_index)

Allocate an old order with the given pool index.

Parameters
pool_indexPool index (zero-based) to allocate.
Returns
Reference to allocated old order.

Definition at line 137 of file order_sl.cpp.

References _old_order_saveload_pool.

Referenced by ORDRChunkHandler::Load().

◆ DeleteOrder()

◆ GetOldOrder()

OldOrderSaveLoadItem * GetOldOrder ( size_t ref_index)

Get a pointer to an old order with the given reference index.

Parameters
ref_indexReference index (one-based) to get.
Returns
Pointer to old order, or nullptr if not present.

Definition at line 125 of file order_sl.cpp.

References _old_order_saveload_pool.

Referenced by OrderList::AfterLoadVehiclesPhase1, BKORChunkHandler::FixPointers(), ORDLChunkHandler::FixPointers(), and ORDRChunkHandler::Load().

◆ InsertOrder()