OpenTTD Source 20260917-master-gec444f7315
SlIndustryAccepted Class Reference
Inheritance diagram for SlIndustryAccepted:
VectorSaveLoadHandler< SlIndustryAccepted, Industry, Industry::AcceptedCargo, INDUSTRY_NUM_INPUTS > DefaultSaveLoadHandler< SlIndustryAccepted, Industry > SaveLoadHandler

Public Member Functions

std::vector< Industry::AcceptedCargo > & GetVector (Industry *i) const override
 Get instance of vector to load/save.
Public Member Functions inherited from VectorSaveLoadHandler< SlIndustryAccepted, Industry, Industry::AcceptedCargo, INDUSTRY_NUM_INPUTS >
virtual size_t GetLength () const
 Get number of elements to load into vector.
void Save (Industry *object) const override
 Save the object to disk.
void Load (Industry *object) const override
 Load the object from disk.
Public Member Functions inherited from DefaultSaveLoadHandler< SlIndustryAccepted, Industry >
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 (Industry *object) const
 Similar to load, but used only to validate savegames.
virtual void FixPointers (Industry *object) const
 A post-load callback to fix SaveLoadType::Reference integers into pointers.
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 Member Functions

static void ResetOldStructure ()

Static Public Attributes

static const SaveLoad description []
static const SaveLoadCompatTable compat_description = _industry_accepts_sl_compat
static std::array< CargoType, INDUSTRY_NUM_INPUTS > old_cargo
static std::array< uint16_t, INDUSTRY_NUM_INPUTS > old_waiting
static std::array< TimerGameEconomy::Date, INDUSTRY_NUM_INPUTS > old_last_accepted

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 59 of file industry_sl.cpp.

Member Function Documentation

◆ GetVector()

std::vector< Industry::AcceptedCargo > & SlIndustryAccepted::GetVector ( Industry * object) const
inlineoverridevirtual

Get instance of vector to load/save.

Parameters
objectObject containing vector.
Returns
Vector to load/save.

Implements VectorSaveLoadHandler< SlIndustryAccepted, Industry, Industry::AcceptedCargo, INDUSTRY_NUM_INPUTS >.

Definition at line 70 of file industry_sl.cpp.

References Industry::accepted.

◆ ResetOldStructure()

void SlIndustryAccepted::ResetOldStructure ( )
inlinestatic

Definition at line 79 of file industry_sl.cpp.

Field Documentation

◆ compat_description

const SaveLoadCompatTable SlIndustryAccepted::compat_description = _industry_accepts_sl_compat
inlinestatic

Definition at line 68 of file industry_sl.cpp.

◆ description

const SaveLoad SlIndustryAccepted::description[]
inlinestatic
Initial value:
= {
}
#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
@ IndustryAcceptedHistory
Saveload version: 357, GitHub pull request: 14321 Add per-industry history of cargo delivered and wa...
Definition saveload.h:414
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

Definition at line 61 of file industry_sl.cpp.

◆ old_cargo

std::array<CargoType, INDUSTRY_NUM_INPUTS> SlIndustryAccepted::old_cargo
inlinestatic

Old array structures used by INDYChunkHandler for savegames before SaveLoadVersion::IndustryCargoReorganise.

Definition at line 74 of file industry_sl.cpp.

◆ old_last_accepted

std::array<TimerGameEconomy::Date, INDUSTRY_NUM_INPUTS> SlIndustryAccepted::old_last_accepted
inlinestatic

Old array structures used by INDYChunkHandler for savegames before SaveLoadVersion::IndustryCargoReorganise.

Definition at line 76 of file industry_sl.cpp.

◆ old_waiting

std::array<uint16_t, INDUSTRY_NUM_INPUTS> SlIndustryAccepted::old_waiting
inlinestatic

Old array structures used by INDYChunkHandler for savegames before SaveLoadVersion::IndustryCargoReorganise.

Definition at line 75 of file industry_sl.cpp.


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