OpenTTD Source
20240919-master-gdf0233f4c2
|
Go to the documentation of this file.
10 #include "../stdafx.h"
15 #include "../autoreplace_base.h"
17 #include "../safeguards.h"
19 static const SaveLoad _engine_renew_desc[] = {
36 SlSetArrayIndex(er->index);
73 extern const ChunkHandlerTable _autoreplace_chunk_handlers(autoreplace_chunk_handlers);
const SaveLoadCompat _engine_renew_sl_compat[]
Original field order for _engine_renew_desc.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Handlers and description of chunk.
#define SLE_REF(base, variable, type)
Storage of a reference in every version of a savegame.
static const GroupID ALL_GROUP
All vehicles are in this group.
void Save() const override
Save the chunk.
static const GroupID DEFAULT_GROUP
Ungrouped vehicles are in this group.
@ SL_MAX_VERSION
Highest possible saveload version.
@ REF_ENGINE_RENEWS
Load/save a reference to an engine renewal (autoreplace).
Struct to store engine replacements.
void FixPointers() const override
Fix the pointers.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
void Load() const override
Load the chunk.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
bool IsSavegameVersionBefore(SaveLoadVersion major, uint8_t minor=0)
Checks whether the savegame is below major.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.