19static const SaveLoad _engine_renew_desc[] = {
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.
#define SLE_OBJECT_ADDRESS(base, variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a base c...
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
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,...
@ Table
An Array with a header describing the elements.
Definition of base types and functions in a cross-platform compatible way.
ChunkHandler(ChunkId id, ChunkType type)
Create this ChunkHandler.
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 SaveLoad Variable(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of a variable in some savegame versions.
static SaveLoad Reference(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion)
Storage of a reference to a pool element in some savegame versions.