20static TownID _town_index;
22static const SaveLoad _depot_desc[] = {
32struct DEPTChunkHandler : ChunkHandler {
33 DEPTChunkHandler() : ChunkHandler(
'DEPT', CH_TABLE) {}
40 SlSetArrayIndex(depot->index);
Base for all depots (except hangars).
Loading for depot chunks before table headers were added.
const SaveLoadCompat _depot_sl_compat[]
Original field order for _depot_desc.
PoolID< uint16_t, struct DepotIDTag, 64000, 0xFFFF > DepotID
Type for the unique identifier of depots.
A number of safeguards to prevent using unsafe methods.
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.
#define SLEG_CONDVAR(name, variable, type, from, to)
Storage of a global variable in some savegame versions.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
@ REF_TOWN
Load/save a reference to a town.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
#define SLE_CONDSSTR(base, variable, type, from, to)
Storage of a std::string in some savegame versions.
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
bool IsSavegameVersionBefore(SaveLoadVersion major, uint8_t minor=0)
Checks whether the savegame is below major.
@ SL_MAX_VERSION
Highest possible saveload version.
@ SL_MIN_VERSION
First savegame version.
#define SLE_CONDREF(base, variable, type, from, to)
Storage of a reference in some savegame versions.
Definition of base types and functions in a cross-platform compatible way.
void Save() const override
Save the chunk.
void Load() const override
Load the chunk.
void FixPointers() const override
Fix the pointers.
static Pool::IterateWrapper< Depot > Iterate(size_t from=0)
static T * CreateAtIndex(DepotID index, Targs &&... args)
static Town * Get(auto index)