OpenTTD Source 20260711-master-g3fb3006dff
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
 Save the object to disk.
void Load (BaseStation *bst) const override
 Load the object from disk.
void FixPointers (BaseStation *bst) const override
 A post-load callback to fix SaveLoadType::Reference integers into pointers.
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 LoadCheck (BaseStation *object) const
 Similar to load, but used only to validate savegames.
Public Member Functions inherited from SaveLoadHandler
virtual ~SaveLoadHandler ()=default
 Ensure the destructor of the sub classes are called as well.
virtual void Save (void *object) const
 Save the object to disk.
virtual void Load (void *object) const
 Load the object from disk.
virtual void LoadCheck (void *object) const
 Similar to load, but used only to validate savegames.
virtual void FixPointers (void *object) const
 A post-load callback to fix SaveLoadType::Reference integers into pointers.
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
 Description derived from savegame being loaded.

Detailed Description

Definition at line 369 of file station_sl.cpp.

Member Function Documentation

◆ FixPointers()

void SlStationGoods::FixPointers ( BaseStation * object) const
inlineoverridevirtual

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

References ExtendCargotypes, IsSavegameVersionBefore(), NewGRFCargo, NUM_CARGO, SaveloadListLength, and SlGetStructListLength().

◆ Load()

◆ Save()

Field Documentation

◆ cargo_reserved_count

uint SlStationGoods::cargo_reserved_count
inlinestatic

Definition at line 371 of file station_sl.cpp.

◆ compat_description

const SaveLoadCompatTable SlStationGoods::compat_description = _station_goods_sl_compat
inlinestatic

Definition at line 398 of file station_sl.cpp.

◆ description

const SaveLoad SlStationGoods::description[]
inlinestatic
Initial value:
= {
SLE_VAR(GoodsEntry, time_since_pickup, VarTypes::U8),
SLEG_CONDVAR("cargo.reserved_count", SlStationGoods::cargo_reserved_count, VarTypes::U32, SaveLoadVersion::CargoReservation, SaveLoadVersion::MaxVersion),
}
@ I64
A 64 bit signed int.
Definition saveload.h:685
@ U16
A 16 bit unsigned int.
Definition saveload.h:682
@ U8
A 8 bit unsigned int.
Definition saveload.h:662
@ U32
A 32 bit unsigned int.
Definition saveload.h:666
#define SLEG_CONDVAR(name, variable, type, from, to)
Storage of a global variable in some savegame versions.
Definition saveload.h:1124
@ CargoPacket
Load/save a reference to a cargo packet.
Definition saveload.h:649
#define SLEG_CONDREFLIST(name, variable, type, from, to)
Storage of a global reference list in some savegame versions.
Definition saveload.h:1174
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:904
@ UnifyCurrency
Saveload version: 65, SVN revision: 10210 Make all variables related to currency 64 bits.
Definition saveload.h:122
@ CargoReservation
Saveload version: 181, SVN revision: 25012 Persist the reservation of cargo for vehicles instead of ...
Definition saveload.h:261
@ LargerCargoSource
Saveload version: 7.0, SVN revision: 1770 With more stations, the size of the cargo source needed to...
Definition saveload.h:49
@ TransferOrder
Saveload version: 14.0, SVN revision: 2441 Transfer orders for feeder systems.
Definition saveload.h:58
@ FractionalCargoDelivery
Saveload version: 150, SVN revision: 20857 When spreading cargo over stations, spread fractional amo...
Definition saveload.h:224
@ CargoSourceTile
Saveload version: 44, SVN revision: 8144 Store the source tile of the cargo, so accurate payment can...
Definition saveload.h:96
@ Cargodist
Saveload version: 183, SVN revision: 25363 Cargodist.
Definition saveload.h:263
@ MinVersion
First savegame version.
Definition saveload.h:31
@ SaveloadListLength
Saveload version: 293, GitHub pull request: 9374 Consistency in list length with SaveLoadType::Struc...
Definition saveload.h:331
@ CargoPackets
Saveload version: 68, SVN revision: 10266 Account for individual units of cargo, i....
Definition saveload.h:125
@ MaxVersion
Highest possible saveload version.
Definition saveload.h:421
#define SLEG_CONDSTRUCTLIST(name, handler, from, to)
Storage of a list of structs in some savegame versions.
Definition saveload.h:1193
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:1017
Stores station stats for a single cargo.
static constexpr VarType U16
Store a 16 bits unsigned int.
Definition saveload.h:754
static constexpr VarType U8
Store a 8 bits unsigned int.
Definition saveload.h:752
static constexpr VarType I64
Store a 64 bits signed int.
Definition saveload.h:757
static constexpr VarType U32
Store a 32 bits unsigned int.
Definition saveload.h:756

Definition at line 373 of file station_sl.cpp.


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