OpenTTD Source
12.0-beta2
|
Go to the documentation of this file.
10 #ifndef ORDER_BACKUP_H
11 #define ORDER_BACKUP_H
uint32 TileIndex
The index/ID of a Tile.
OrderBackupPool _order_backup_pool
The pool with order backups.
ChunkType type
Type of the chunk.
static void ResetOfUser(TileIndex tile, uint32 user)
Reset an OrderBackup given a tile and user.
const Vehicle * clone
Vehicle this vehicle was a clone of.
static void ClearVehicle(const Vehicle *v)
Clear/update the (clone) vehicle from an order backup.
Pool< OrderBackup, OrderBackupID, 1, 256 > OrderBackupPool
The pool type for order backups.
A trimmed down version of what std::span will be in C++20.
uint8 OrderBackupID
Unique identifier for an order backup.
static const uint32 MAKE_ORDER_BACKUP_FLAG
Flag to pass to the vehicle construction command when an order should be preserved.
static void Restore(Vehicle *v, uint32 user)
Restore the data of this order to the given vehicle.
static void Reset(TileIndex tile=INVALID_TILE, bool from_gui=true)
Reset the OrderBackups from GUI/game logic.
uint32 user
The user that requested the backup.
void DoRestore(Vehicle *v)
Restore the data of this order to the given vehicle.
friend SaveLoadTable GetOrderBackupDescription()
Saving and loading of order backups.
Base class for all pools.
~OrderBackup()
Free everything that is allocated.
uint16 GroupID
Type for all group identifiers.
Order * orders
The actual orders if the vehicle was not a clone.
TileIndex tile
Tile of the depot where the order was changed.
static void ClearGroup(GroupID group)
Clear the group of all backups having this group ID.
static void RemoveOrder(OrderType type, DestinationID destination, bool hangar)
Removes an order from all vehicles.
static void Backup(const Vehicle *v, uint32 user)
Create an order backup for the given vehicle.
static void ResetUser(uint32 user)
Reset an user's OrderBackup if needed.
static const TileIndex INVALID_TILE
The very nice invalid tile marker.
GroupID group
The group the vehicle was part of.
OrderBackup()
Creation for savegame restoration.
Data for backing up an order of a vehicle so it can be restored after a vehicle is rebuilt in the sam...
Various front vehicle properties that are preserved when autoreplacing, using order-backup or switchi...
Base class for all PoolItems.