OpenTTD Source  20240919-master-gdf0233f4c2
SlStationGoods Class Reference
Inheritance diagram for SlStationGoods:
DefaultSaveLoadHandler< SlStationGoods, BaseStation > SaveLoadHandler

Public Member Functions

size_t GetNumCargo () const
 Get the number of cargoes used by this savegame version. More...
 
void Save (BaseStation *bst) const override
 
void Load (BaseStation *bst) const override
 
void FixPointers (BaseStation *bst) const override
 
- Public Member Functions inherited from DefaultSaveLoadHandler< SlStationGoods, BaseStation >
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 Save ([[maybe_unused]] BaseStation *object) const
 
void Save (void *object) const override
 
virtual void Load ([[maybe_unused]] BaseStation *object) const
 
void Load (void *object) const override
 
virtual void LoadCheck ([[maybe_unused]] BaseStation *object) const
 
void LoadCheck (void *object) const override
 
virtual void FixPointers ([[maybe_unused]] BaseStation *object) const
 
void FixPointers (void *object) const override
 
- Public Member Functions inherited from SaveLoadHandler
virtual void Save ([[maybe_unused]] void *object) const
 Save the object to disk. More...
 
virtual void Load ([[maybe_unused]] void *object) const
 Load the object from disk. More...
 
virtual void LoadCheck ([[maybe_unused]] void *object) const
 Similar to load, but used only to validate savegames. More...
 
virtual void FixPointers ([[maybe_unused]] void *object) const
 A post-load callback to fix SL_REF integers into pointers. More...
 
virtual SaveLoadTable GetDescription () const =0
 Get the description of the fields in the savegame.
 
virtual SaveLoadCompatTable GetCompatDescription () const =0
 Get the pre-header description of the fields in the savegame.
 
SaveLoadTable GetLoadDescription () const
 Get the description for how to load the chunk. More...
 

Static Public Attributes

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

Additional Inherited Members

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

Detailed Description

Definition at line 330 of file station_sl.cpp.

Member Function Documentation

◆ GetNumCargo()

size_t SlStationGoods::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 363 of file station_sl.cpp.

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

Field Documentation

◆ description

const SaveLoad SlStationGoods::description[]
inlinestatic
Initial value:
= {
SLEG_CONDVAR("waiting_acceptance", _waiting_acceptance, SLE_UINT16, SL_MIN_VERSION, SLV_68),
SLE_VAR(GoodsEntry, time_since_pickup, SLE_UINT8),
SLE_VAR(GoodsEntry, rating, SLE_UINT8),
SLEG_CONDVAR("cargo_source", _cargo_source, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_7),
SLEG_CONDVAR("cargo_source", _cargo_source, SLE_UINT16, SLV_7, SLV_68),
SLEG_CONDVAR("cargo_source_xy", _cargo_source_xy, SLE_UINT32, SLV_44, SLV_68),
SLEG_CONDVAR("cargo_days", _cargo_periods, SLE_UINT8, SL_MIN_VERSION, SLV_68),
SLE_VAR(GoodsEntry, last_speed, SLE_UINT8),
SLE_VAR(GoodsEntry, last_age, SLE_UINT8),
SLEG_CONDVAR("cargo_feeder_share", _cargo_feeder_share, SLE_FILE_U32 | SLE_VAR_I64, SLV_14, SLV_65),
SLEG_CONDVAR("cargo_feeder_share", _cargo_feeder_share, SLE_INT64, SLV_65, SLV_68),
SLE_CONDVAR(GoodsEntry, amount_fract, SLE_UINT8, SLV_150, SL_MAX_VERSION),
SLEG_CONDVAR("old_num_dests", _old_num_dests, SLE_UINT32, SLV_183, SLV_SAVELOAD_LIST_LENGTH),
SLE_CONDVAR(GoodsEntry, cargo.reserved_count, SLE_UINT, SLV_181, SL_MAX_VERSION),
SLE_CONDVAR(GoodsEntry, link_graph, SLE_UINT16, SLV_183, SL_MAX_VERSION),
SLEG_CONDVAR("old_num_flows", _old_num_flows, SLE_UINT32, SLV_183, SLV_SAVELOAD_LIST_LENGTH),
SLE_CONDVAR(GoodsEntry, max_waiting_cargo, SLE_UINT32, SLV_183, SL_MAX_VERSION),
}

Definition at line 332 of file station_sl.cpp.


The documentation for this class was generated from the following file:
SLEG_CONDSTRUCTLIST
#define SLEG_CONDSTRUCTLIST(name, handler, from, to)
Storage of a list of structs in some savegame versions.
Definition: saveload.h:1139
SL_MIN_VERSION
@ SL_MIN_VERSION
First savegame version.
Definition: saveload.h:31
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:857
SLEG_CONDREFLIST
#define SLEG_CONDREFLIST(name, variable, type, from, to)
Storage of a global reference list in some savegame versions.
Definition: saveload.h:1120
SLV_14
@ SLV_14
14.0 2441
Definition: saveload.h:57
SLV_150
@ SLV_150
150 20857
Definition: saveload.h:223
SlStationCargo
Definition: station_sl.cpp:241
SLV_SAVELOAD_LIST_LENGTH
@ SLV_SAVELOAD_LIST_LENGTH
293 PR#9374 Consistency in list length with SL_STRUCT / SL_STRUCTLIST / SL_DEQUE / SL_REFLIST.
Definition: saveload.h:331
SLV_65
@ SLV_65
65 10210
Definition: saveload.h:121
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:391
REF_CARGO_PACKET
@ REF_CARGO_PACKET
Load/save a reference to a cargo packet.
Definition: saveload.h:600
SLV_181
@ SLV_181
181 25012
Definition: saveload.h:260
GoodsEntry
Stores station stats for a single cargo.
Definition: station_base.h:166
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:971
SLEG_CONDVAR
#define SLEG_CONDVAR(name, variable, type, from, to)
Storage of a global variable in some savegame versions.
Definition: saveload.h:1070
SLV_7
@ SLV_7
7.0 1770
Definition: saveload.h:48
SLV_183
@ SLV_183
183 25363 Cargodist
Definition: saveload.h:262
SlStationFlow
Definition: station_sl.cpp:277
SLV_68
@ SLV_68
68 10266
Definition: saveload.h:124
SLV_44
@ SLV_44
44 8144
Definition: saveload.h:95