19static const SaveLoad _subsidies_desc[] = {
32struct SUBSChunkHandler : ChunkHandler {
40 SlSetArrayIndex(s->index);
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.
@ U16
A 16 bit unsigned int.
@ U8
A 8 bit unsigned int.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
@ BigMap
Saveload version: 5.0, SVN revision: 1429 Making maps a different size than 256x256.
@ RemoveSubsidyStationBinding
Saveload version: 125, SVN revision: 17113 Awarded subsidies are not bound to stations,...
@ MinVersion
First savegame version.
@ CustomSubsidyDuration
Saveload version: 292, GitHub pull request: 9081 Configurable subsidy duration.
@ MaxVersion
Highest possible saveload version.
@ Table
An Array with a header describing the elements.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
#define SLE_CONDVARNAME(base, variable, name, type, from, to)
Storage of a variable in some savegame versions.
Definition of base types and functions in a cross-platform compatible way.
static Pool::IterateWrapper< Subsidy > Iterate(size_t from=0)
static T * CreateAtIndex(SubsidyID index, Targs &&... args)
void Save() const override
Save the chunk.
void Load() const override
Load the chunk.
Struct about subsidies, offered and awarded.
static constexpr VarType U16
Store a 16 bits unsigned int.
static constexpr VarType U8
Store a 8 bits unsigned int.
Loading of subsidy chunks before table headers were added.
const SaveLoadCompat _subsidies_sl_compat[]
Original field order for _subsidies_desc.
PoolID< uint16_t, struct SubsidyIDTag, 256, 0xFFFF > SubsidyID
ID of a subsidy.