OpenTTD Source  12.0-beta2
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.
 
void Save (void *object) const override
 Save the object to disk. More...
 
void Load (void *object) const override
 Load the object from disk. More...
 
virtual void LoadCheck (BaseStation *object) const
 
void LoadCheck (void *object) const override
 Similar to load, but used only to validate savegames. More...
 
void FixPointers (void *object) const override
 A post-load callback to fix SL_REF integers into pointers. More...
 
- Public Member Functions inherited from SaveLoadHandler
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 317 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_days, 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 329 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:929
SLV_65
@ SLV_65
65 10210
Definition: saveload.h:125
SL_MIN_VERSION
@ SL_MIN_VERSION
First savegame version.
Definition: saveload.h:35
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:702
SLEG_CONDREFLIST
#define SLEG_CONDREFLIST(name, variable, type, from, to)
Storage of a global reference list in some savegame versions.
Definition: saveload.h:910
SLV_181
@ SLV_181
181 25012
Definition: saveload.h:264
SLV_14
@ SLV_14
14.0 2441
Definition: saveload.h:61
SLV_150
@ SLV_150
150 20857
Definition: saveload.h:227
SlStationCargo
Definition: station_sl.cpp:228
SLV_183
@ SLV_183
183 25363 Cargodist
Definition: saveload.h:266
SLV_7
@ SLV_7
7.0 1770
Definition: saveload.h:52
REF_CARGO_PACKET
@ REF_CARGO_PACKET
Load/save a reference to a cargo packet.
Definition: saveload.h:542
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:342
GoodsEntry
Stores station stats for a single cargo.
Definition: station_base.h:167
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:772
SLEG_CONDVAR
#define SLEG_CONDVAR(name, variable, type, from, to)
Storage of a global variable in some savegame versions.
Definition: saveload.h:849
SLV_44
@ SLV_44
44 8144
Definition: saveload.h:99
SlStationFlow
Definition: station_sl.cpp:264
SLV_68
@ SLV_68
68 10266
Definition: saveload.h:128
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:335