15#include "../autoreplace_base.h"
17#include "../safeguards.h"
19static const SaveLoad _engine_renew_desc[] = {
36 SlSetArrayIndex(er->index);
73extern const ChunkHandlerTable _autoreplace_chunk_handlers(autoreplace_chunk_handlers);
Loading for autoreplace chunks before table headers were added.
const SaveLoadCompat _engine_renew_sl_compat[]
Original field order for _engine_renew_desc.
static const GroupID DEFAULT_GROUP
Ungrouped vehicles are in this group.
static const GroupID ALL_GROUP
All vehicles are in this group.
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_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.
@ SL_MAX_VERSION
Highest possible saveload version.
@ REF_ENGINE_RENEWS
Load/save a reference to an engine renewal (autoreplace).
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Handlers and description of chunk.
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< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.