|
OpenTTD Source 20251117-master-g7398d2e290
|
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 | |
| OldOrderSaveLoadItem * | GetOldOrder (size_t pool_index) |
| Get a pointer to an old order with the given reference index. | |
| OldOrderSaveLoadItem & | AllocateOldOrder (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 |
Base class for orders.
Definition in file order_base.h.
| using OrderListPool = Pool<OrderList, OrderListID, 128> |
Definition at line 23 of file order_base.h.
| OldOrderSaveLoadItem & AllocateOldOrder | ( | size_t | pool_index | ) |
Allocate an old order with the given pool index.
| pool_index | Pool index (zero-based) to allocate. |
Definition at line 134 of file order_sl.cpp.
References _old_order_saveload_pool.
Referenced by ORDRChunkHandler::Load().
| void DeleteOrder | ( | Vehicle * | v, |
| VehicleOrderID | sel_ord | ||
| ) |
Delete an order but skip the parameter validation.
| v | The vehicle to delete the order from. |
| sel_ord | The id of the order to be deleted. |
Definition at line 959 of file order_cmd.cpp.
References CancelLoadingDueToDeletedOrder(), BaseConsist::cur_implicit_order_index, BaseConsist::cur_real_order_index, Vehicle::current_order, OrderList::DeleteOrderAt(), DeleteOrderWarnings(), Vehicle::FirstShared(), Vehicle::GetNumOrders(), Vehicle::GetOrder(), GetWindowClassForVehicleType(), INVALID_VEH_ORDER_ID, InvalidateVehicleOrder(), InvalidateWindowClassesData(), Order::IsType(), Vehicle::NextShared(), Vehicle::orders, BaseConsist::ResetDepotUnbunching(), BaseVehicle::type, and Vehicle::UpdateRealOrderIndex().
Referenced by Vehicle::BeginLoading(), CmdDeleteOrder(), Vehicle::DeleteUnreachedImplicitOrders(), and RemoveOrderFromAllVehicles().
| OldOrderSaveLoadItem * GetOldOrder | ( | size_t | ref_index | ) |
Get a pointer to an old order with the given reference index.
| ref_index | Reference index (one-based) to get. |
Definition at line 122 of file order_sl.cpp.
References _old_order_saveload_pool.
Referenced by ORDLChunkHandler::FixPointers(), BKORChunkHandler::FixPointers(), and ORDRChunkHandler::Load().
| void InsertOrder | ( | Vehicle * | v, |
| Order && | new_o, | ||
| VehicleOrderID | sel_ord | ||
| ) |
Insert a new order but skip the validation.
| 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 834 of file order_cmd.cpp.
References BaseConsist::cur_implicit_order_index, BaseConsist::cur_real_order_index, DeleteOrderWarnings(), Vehicle::FirstShared(), Vehicle::GetGroundVehicleFlags(), Vehicle::GetNumOrders(), GetWindowClassForVehicleType(), GVF_SUPPRESS_IMPLICIT_ORDERS, OrderList::InsertOrderAt(), INVALID_VEH_ORDER_ID, InvalidateVehicleOrder(), InvalidateWindowClassesData(), Vehicle::IsGroundVehicle(), Vehicle::NextShared(), Vehicle::orders, BaseConsist::ResetDepotUnbunching(), SetBit(), and BaseVehicle::type.
Referenced by Vehicle::BeginLoading(), and CmdInsertOrder().