OpenTTD Source 20241224-master-gf74b0cf984
SlTownSupplied Class Reference
Inheritance diagram for SlTownSupplied:
DefaultSaveLoadHandler< SlTownSupplied, Town > SaveLoadHandler

Public Member Functions

size_t GetNumCargo () const
 Get the number of cargoes used by this savegame version.
 
void Save (Town *t) const override
 
void Load (Town *t) const override
 
- Public Member Functions inherited from DefaultSaveLoadHandler< SlTownSupplied, Town >
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.
 
void Save (void *object) const override
 Save the object to disk.
 
void Load (void *object) const override
 Load the object from disk.
 
virtual void LoadCheck (Town *object) const
 
void LoadCheck (void *object) const override
 Similar to load, but used only to validate savegames.
 
virtual void FixPointers (Town *object) const
 
void FixPointers (void *object) const override
 A post-load callback to fix SL_REF integers into pointers.
 
- Public Member Functions inherited from SaveLoadHandler
SaveLoadTable GetLoadDescription () const
 Get the description for how to load the chunk.
 

Static Public Attributes

static const SaveLoad description []
 
static const SaveLoadCompatTable compat_description = _town_supplied_sl_compat
 

Additional Inherited Members

- Data Fields inherited from SaveLoadHandler
std::optional< std::vector< SaveLoad > > load_description
 

Detailed Description

Definition at line 115 of file town_sl.cpp.

Member Function Documentation

◆ GetNumCargo()

size_t SlTownSupplied::GetNumCargo ( ) const
inline

Get the number of cargoes used by this savegame version.

Returns
The number of cargoes used by this savegame version.

Definition at line 129 of file town_sl.cpp.

References IsSavegameVersionBefore(), NUM_CARGO, SlGetStructListLength(), SLV_EXTEND_CARGOTYPES, and SLV_SAVELOAD_LIST_LENGTH.

◆ Load()

void SlTownSupplied::Load ( Town t) const
inlineoverridevirtual

Reimplemented from DefaultSaveLoadHandler< SlTownSupplied, Town >.

Definition at line 145 of file town_sl.cpp.

◆ Save()

void SlTownSupplied::Save ( Town t) const
inlineoverridevirtual

Reimplemented from DefaultSaveLoadHandler< SlTownSupplied, Town >.

Definition at line 137 of file town_sl.cpp.

Field Documentation

◆ compat_description

const SaveLoadCompatTable SlTownSupplied::compat_description = _town_supplied_sl_compat
inlinestatic

Definition at line 123 of file town_sl.cpp.

◆ description

const SaveLoad SlTownSupplied::description[]
inlinestatic
Initial value:
= {
}
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:868
@ SL_MAX_VERSION
Highest possible saveload version.
Definition saveload.h:399
@ SLV_165
165 23304
Definition saveload.h:241
Store the maximum and actually transported cargo amount for the current and the last month.
Definition town_type.h:113

Definition at line 117 of file town_sl.cpp.


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