OpenTTD Source 20241224-master-gee860a5c8e
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.
 
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.
 
void Load (void *object) const override
 Load the object from disk.
 
virtual void LoadCheck (BaseStation *object) const
 
void LoadCheck (void *object) const override
 Similar to load, but used only to validate savegames.
 
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 = _station_goods_sl_compat
 

Additional Inherited Members

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

Detailed Description

Definition at line 316 of file station_sl.cpp.

Member Function Documentation

◆ FixPointers()

void SlStationGoods::FixPointers ( BaseStation bst) const
inlineoverridevirtual

Reimplemented from DefaultSaveLoadHandler< SlStationGoods, BaseStation >.

Definition at line 409 of file station_sl.cpp.

◆ 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 349 of file station_sl.cpp.

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

◆ Load()

void SlStationGoods::Load ( BaseStation bst) const
inlineoverridevirtual

Reimplemented from DefaultSaveLoadHandler< SlStationGoods, BaseStation >.

Definition at line 369 of file station_sl.cpp.

◆ Save()

void SlStationGoods::Save ( BaseStation bst) const
inlineoverridevirtual

Reimplemented from DefaultSaveLoadHandler< SlStationGoods, BaseStation >.

Definition at line 358 of file station_sl.cpp.

Field Documentation

◆ compat_description

const SaveLoadCompatTable SlStationGoods::compat_description = _station_goods_sl_compat
inlinestatic

Definition at line 343 of file station_sl.cpp.

◆ 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:1109
#define SLEG_CONDREFLIST(name, variable, type, from, to)
Storage of a global reference list in some savegame versions.
Definition saveload.h:1159
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:868
@ 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:399
@ 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:608
#define SLEG_CONDSTRUCTLIST(name, handler, from, to)
Storage of a list of structs in some savegame versions.
Definition saveload.h:1178
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:1002
Stores station stats for a single cargo.

Definition at line 318 of file station_sl.cpp.


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