OpenTTD Source 20261129-master-g72a8bdc861
SlGroupEngineRenews Class Reference

Saveload handler for group engine renew entries. More...

Inheritance diagram for SlGroupEngineRenews:
VectorSaveLoadHandler< SlGroupEngineRenews, Group, EngineRenew > DefaultSaveLoadHandler< SlGroupEngineRenews, Group > SaveLoadHandler

Public Member Functions

std::vector< EngineRenew > & GetVector (Group *g) const override
 Get instance of vector to load/save.
Public Member Functions inherited from VectorSaveLoadHandler< SlGroupEngineRenews, Group, EngineRenew >
virtual size_t GetLength () const
 Get number of elements to load into vector.
void Save (Group *object) const override
 Save the object to disk.
void Load (Group *object) const override
 Load the object from disk.
Public Member Functions inherited from DefaultSaveLoadHandler< SlGroupEngineRenews, Group >
SaveLoadTable GetDescription () const override
 Get the description of the fields in the savegame.
SaveLoadCompatTable GetCompatDescription () const override
 Get the pre-header description of the fields in the savegame.
virtual void LoadCheck (Group *object) const
 Similar to load, but used only to validate savegames.
virtual void FixPointers (Group *object) const
 A post-load callback to fix SaveLoadType::Reference integers into pointers.
Public Member Functions inherited from SaveLoadHandler
virtual ~SaveLoadHandler ()=default
 Ensure the destructor of the sub classes are called as well.
virtual void Save (void *object) const
 Save the object to disk.
virtual void Load (void *object) const
 Load the object from disk.
virtual void LoadCheck (void *object) const
 Similar to load, but used only to validate savegames.
virtual void FixPointers (void *object) const
 A post-load callback to fix SaveLoadType::Reference integers into pointers.
SaveLoadTable GetLoadDescription () const
 Get the description for how to load the chunk.

Static Public Attributes

static const SaveLoad description []
 Saveload description for handler.
static const SaveLoadCompatTable compat_description = {}
 Compatibility saveload description for handler.

Additional Inherited Members

Data Fields inherited from SaveLoadHandler
std::optional< std::vector< SaveLoad > > load_description
 Description derived from savegame being loaded.

Detailed Description

Saveload handler for group engine renew entries.

Definition at line 21 of file group_sl.cpp.

Member Function Documentation

◆ GetVector()

std::vector< EngineRenew > & SlGroupEngineRenews::GetVector ( Group * object) const
inlineoverridevirtual

Get instance of vector to load/save.

Parameters
objectObject containing vector.
Returns
Vector to load/save.

Implements VectorSaveLoadHandler< SlGroupEngineRenews, Group, EngineRenew >.

Definition at line 32 of file group_sl.cpp.

References Group::engine_renew_list.

Field Documentation

◆ compat_description

const SaveLoadCompatTable SlGroupEngineRenews::compat_description = {}
inlinestatic

Compatibility saveload description for handler.

Definition at line 30 of file group_sl.cpp.

◆ description

const SaveLoad SlGroupEngineRenews::description[]
inlinestatic
Initial value:
= {
SaveLoad::Variable<VarFileType::Bool>("replace_when_old", SLE_OBJECT_ADDRESS(EngineRenew, replace_when_old)),
}
#define SLE_OBJECT_ADDRESS(base, variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a base c...
Definition saveload.h:752
Information about engine autorenews and autoreplacements.
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.
Definition saveload.h:923

Saveload description for handler.

Definition common with SlCompanyEngineRenews

Definition at line 24 of file group_sl.cpp.


The documentation for this class was generated from the following file: