OpenTTD Source 20260324-master-gd9c35037d4
SlTownAcceptedHistory Class Reference

Saveload handler for town accepted cargo history entries. More...

Inheritance diagram for SlTownAcceptedHistory:
DefaultSaveLoadHandler< SlTownAcceptedHistory, Town::AcceptedCargo > SaveLoadHandler

Public Member Functions

void Save (Town::AcceptedCargo *p) const override
 Save the object to disk.
void Load (Town::AcceptedCargo *p) const override
 Load the object from disk.
Public Member Functions inherited from DefaultSaveLoadHandler< SlTownAcceptedHistory, Town::AcceptedCargo >
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 (Town::AcceptedCargo *object) const
 Similar to load, but used only to validate savegames.
virtual void FixPointers (Town::AcceptedCargo *object) const
 A post-load callback to fix SL_REF 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 SL_REF 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 town accepted cargo history entries.

Definition at line 198 of file town_sl.cpp.

Member Function Documentation

◆ Load()

void SlTownAcceptedHistory::Load ( Town::AcceptedCargo * object) const
inlineoverridevirtual

Load the object from disk.

Parameters
objectThe object to load.

Reimplemented from DefaultSaveLoadHandler< SlTownAcceptedHistory, Town::AcceptedCargo >.

Definition at line 216 of file town_sl.cpp.

References SaveLoadHandler::GetLoadDescription(), Town::AcceptedCargo::history, SlGetStructListLength(), and SlObject().

◆ Save()

void SlTownAcceptedHistory::Save ( Town::AcceptedCargo * object) const
inlineoverridevirtual

Field Documentation

◆ compat_description

const SaveLoadCompatTable SlTownAcceptedHistory::compat_description = {}
inlinestatic

Compatibility saveload description for handler.

Definition at line 205 of file town_sl.cpp.

◆ description

const SaveLoad SlTownAcceptedHistory::description[]
inlinestatic
Initial value:
= {
SLE_VAR(Town::AcceptedHistory, accepted, SLE_UINT32),
}
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:1041
Individual data point for accepted cargo history.
Definition town.h:110

Saveload description for handler.

Definition at line 201 of file town_sl.cpp.


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