15#include "../newgrf_storage.h"
17#include "../safeguards.h"
50 SlSetArrayIndex(ps->index);
61extern const ChunkHandlerTable _persistent_storage_chunk_handlers(persistent_storage_chunk_handlers);
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
Functions/types related to saving and loading games.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
#define SLE_CONDARR(base, variable, type, length, from, to)
Storage of a fixed-size array of SL_VAR elements in some savegame versions.
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
@ SL_MAX_VERSION
Highest possible saveload version.
@ SLV_EXTEND_PERSISTENT_STORAGE
201 PR#6885 Extend NewGRF persistent storages.
static const SaveLoad _storage_desc[]
Description of the data to save and load in PersistentStorage.
Loading of storage chunks before table headers were added.
const SaveLoadCompat _storage_sl_compat[]
Original field order for _storage_desc.
Handlers and description of chunk.
void Save() const override
Save the chunk.
void Load() const override
Load the chunk.
Class for pooled persistent storage of data.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
static bool CanAllocateItem(size_t n=1)
Helper functions so we can use PoolItem::Function() instead of _poolitem_pool.Function()