19static const SaveLoad _engine_renew_desc[] = {
28struct ERNWChunkHandler : ChunkHandler {
36 SlSetArrayIndex(er->index);
73extern const ChunkHandlerTable _autoreplace_chunk_handlers(autoreplace_chunk_handlers);
Base class for autoreplaces/autorenews.
Loading for autoreplace chunks before table headers were added.
const SaveLoadCompat _engine_renew_sl_compat[]
Original field order for _engine_renew_desc.
static constexpr GroupID DEFAULT_GROUP
Ungrouped vehicles are in this group.
static constexpr GroupID ALL_GROUP
All vehicles are in this group.
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.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
@ EngineRenew
Load/save a reference to an engine renewal (autoreplace).
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
#define SLE_REF(base, variable, type)
Storage of a reference in every version of a savegame.
#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.
@ UngroupedVehicles
Saveload version: 71, SVN revision: 10567 Add a group with vehicles that aren't in any other group.
@ VehicleGroups
Saveload version: 60, SVN revision: 9874 Arbitrary grouping, by the player, of vehicles.
@ AutoreplaceWhenOldTreeLimit
Saveload version: 175, SVN revision: 24136 Autoreplace vehicle only when they are old,...
@ 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.
Definition of base types and functions in a cross-platform compatible way.
void FixPointers() const override
Fix the pointers.
void Load() const override
Load the chunk.
void Save() const override
Save the chunk.
Struct to store engine replacements.
static Pool::IterateWrapper< EngineRenew > Iterate(size_t from=0)
static T * CreateAtIndex(EngineRenewID index, Targs &&... args)
static constexpr VarType U16
Store a 16 bits unsigned int.
static constexpr VarType BOOL
Store a boolean (as int8).