OpenTTD Source  20241108-master-g80f628063a
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...
 
SaveLoadTable GetLoadDescription () const
 Get the description for how to load the chunk. More...
 

Static Public Attributes

static const SaveLoad description []
 
static const 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),
}
#define SLEG_CONDVAR(name, variable, type, from, to)
Storage of a global variable in some savegame versions.
Definition: saveload.h:1074
#define SLEG_CONDREFLIST(name, variable, type, from, to)
Storage of a global reference list in some savegame versions.
Definition: saveload.h:1124
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:861
@ SLV_150
150 20857
Definition: saveload.h:223
@ SLV_44
44 8144
Definition: saveload.h:95
@ SLV_181
181 25012
Definition: saveload.h:260
@ 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
65 10210
Definition: saveload.h:121
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:395
@ SL_MIN_VERSION
First savegame version.
Definition: saveload.h:31
@ SLV_68
68 10266
Definition: saveload.h:124
@ SLV_14
14.0 2441
Definition: saveload.h:57
@ SLV_7
7.0 1770
Definition: saveload.h:48
@ SLV_183
183 25363 Cargodist
Definition: saveload.h:262
@ REF_CARGO_PACKET
Load/save a reference to a cargo packet.
Definition: saveload.h:604
#define SLEG_CONDSTRUCTLIST(name, handler, from, to)
Storage of a list of structs in some savegame versions.
Definition: saveload.h:1143
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:975
Stores station stats for a single cargo.
Definition: station_base.h:166

Definition at line 332 of file station_sl.cpp.


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