OpenTTD Source 20260917-master-gec444f7315
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 370 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 405 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 372 of file station_sl.cpp.

◆ compat_description

const SaveLoadCompatTable SlStationGoods::compat_description = _station_goods_sl_compat
inlinestatic

Definition at line 399 of file station_sl.cpp.

◆ description

const SaveLoad SlStationGoods::description[]
inlinestatic
Initial value:
= {
SaveLoad::Variable<VarFileType::U8>("time_since_pickup", SLE_OBJECT_ADDRESS(GoodsEntry, time_since_pickup)),
SaveLoad::Variable<VarFileType::U32>("cargo.reserved_count", SLE_GLOBAL_ADDRESS(SlStationGoods::cargo_reserved_count), SaveLoadVersion::CargoReservation),
}
#define SLE_OBJECT_ADDRESS(base, variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a base c...
Definition saveload.h:754
#define SLE_GLOBAL_ADDRESS(variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a global...
Definition saveload.h:761
@ UnifyCurrency
Saveload version: 65, SVN revision: 10210 Make all variables related to currency 64 bits.
Definition saveload.h:128
@ CargoReservation
Saveload version: 181, SVN revision: 25012 Persist the reservation of cargo for vehicles instead of ...
Definition saveload.h:267
@ LargerCargoSource
Saveload version: 7.0, SVN revision: 1770 With more stations, the size of the cargo source needed to...
Definition saveload.h:55
@ TransferOrder
Saveload version: 14.0, SVN revision: 2441 Transfer orders for feeder systems.
Definition saveload.h:64
@ FractionalCargoDelivery
Saveload version: 150, SVN revision: 20857 When spreading cargo over stations, spread fractional amo...
Definition saveload.h:230
@ CargoSourceTile
Saveload version: 44, SVN revision: 8144 Store the source tile of the cargo, so accurate payment can...
Definition saveload.h:102
@ Cargodist
Saveload version: 183, SVN revision: 25363 Cargodist.
Definition saveload.h:269
@ MinVersion
First savegame version.
Definition saveload.h:37
@ SaveloadListLength
Saveload version: 293, GitHub pull request: 9374 Consistency in list length with SaveLoadType::Struc...
Definition saveload.h:337
@ CargoPackets
Saveload version: 68, SVN revision: 10266 Account for individual units of cargo, i....
Definition saveload.h:131
Stores station stats for a single cargo.
static SaveLoad StructList(std::string name, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion)
Storage of a list of structs, optionally in some savegame versions.
Definition saveload.h:1103
static SaveLoad Variable(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of a variable in some savegame versions.
Definition saveload.h:926
static SaveLoad ReferenceList(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion)
Storage of a list of references to pool elements in some savegame versions.
Definition saveload.h:1078

Definition at line 374 of file station_sl.cpp.


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