OpenTTD Source: SlStationGoods Class Reference

OpenTTD Source 15.3

Public Member Functions | Static Public Attributes
SlStationGoods Class Reference
Inheritance diagram for SlStationGoods:

## 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 uint | cargo_reserved_count
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 338 of file station_sl.cpp.

## Member Function Documentation

## ◆ FixPointers()

void SlStationGoods::FixPointers | ( | BaseStation * | bst | ) | const
| inlineoverridevirtual

Reimplemented from DefaultSaveLoadHandler< SlStationGoods, BaseStation >.

Definition at line 437 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 373 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 394 of file station_sl.cpp.

## ◆ Save()

void SlStationGoods::Save | ( | BaseStation * | bst | ) | const
| inlineoverridevirtual

Reimplemented from DefaultSaveLoadHandler< SlStationGoods, BaseStation >.

Definition at line 382 of file station_sl.cpp.

## Field Documentation

## ◆ cargo_reserved_count

uint SlStationGoods::cargo_reserved_count
| inlinestatic

Definition at line 340 of file station_sl.cpp.

## ◆ compat_description

const SaveLoadCompatTable SlStationGoods::compat_description = _station_goods_sl_compat
| inlinestatic

Definition at line 367 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_CONDVAR(GoodsEntry, status, SLE_UINT8, SLV_68, SL_MAX_VERSION),
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_CONDREFLIST("packets", _packets, REF_CARGO_PACKET, SLV_68, SLV_183),
SLEG_CONDVAR("old_num_dests", _old_num_dests, SLE_UINT32, SLV_183, SLV_SAVELOAD_LIST_LENGTH),
SLEG_CONDVAR("cargo.reserved_count", SlStationGoods::cargo_reserved_count, SLE_UINT, SLV_181, SL_MAX_VERSION),
SLE_CONDVAR(GoodsEntry, link_graph, SLE_UINT16, SLV_183, SL_MAX_VERSION),
SLE_CONDVAR(GoodsEntry, node, 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),
SLEG_CONDSTRUCTLIST("flow", SlStationFlow, SLV_183, SL_MAX_VERSION),
SLEG_CONDSTRUCTLIST("cargo", SlStationCargo, SLV_183, SL_MAX_VERSION),
}
SlStationCargo
Definition station_sl.cpp:232
SlStationFlow
Definition station_sl.cpp:278
SLEG_CONDVAR
#define SLEG_CONDVAR(name, variable, type, from, to)
Storage of a global variable in some savegame versions.
Definition saveload.h:1124
REF_CARGO_PACKET
@ REF_CARGO_PACKET
Load/save a reference to a cargo packet.
Definition saveload.h:622
SLEG_CONDREFLIST
#define SLEG_CONDREFLIST(name, variable, type, from, to)
Storage of a global reference list in some savegame versions.
Definition saveload.h:1174
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:883
SLV_150
@ SLV_150
150 20857
Definition saveload.h:223
SLV_44
@ SLV_44
44 8144
Definition saveload.h:95
SLV_181
@ SLV_181
181 25012
Definition saveload.h:260
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:416
SL_MIN_VERSION
@ SL_MIN_VERSION
First savegame version.
Definition saveload.h:31
SLV_68
@ SLV_68
68 10266
Definition saveload.h:124
SLV_14
@ SLV_14
14.0 2441
Definition saveload.h:57
SLV_7
@ SLV_7
7.0 1770
Definition saveload.h:48
SLV_183
@ SLV_183
183 25363 Cargodist
Definition saveload.h:262
SLEG_CONDSTRUCTLIST
#define SLEG_CONDSTRUCTLIST(name, handler, from, to)
Storage of a list of structs in some savegame versions.
Definition saveload.h:1193
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:1017
GoodsEntry
Stores station stats for a single cargo.
Definition station_base.h:167

Definition at line 342 of file station_sl.cpp.

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

- src/saveload/station_sl.cpp