OpenTTD Source  20240919-master-gdf0233f4c2
SlCompanyEconomy Class Reference
Inheritance diagram for SlCompanyEconomy:
DefaultSaveLoadHandler< SlCompanyEconomy, CompanyProperties > SaveLoadHandler SlCompanyOldEconomy

Public Member Functions

void Save (CompanyProperties *c) const override
 
void Load (CompanyProperties *c) const override
 
void FixPointers (CompanyProperties *c) const override
 
void LoadCheck (CompanyProperties *c) const override
 
- Public Member Functions inherited from DefaultSaveLoadHandler< SlCompanyEconomy, CompanyProperties >
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 Save ([[maybe_unused]] CompanyProperties *object) const
 
void Save (void *object) const override
 
virtual void Load ([[maybe_unused]] CompanyProperties *object) const
 
void Load (void *object) const override
 
virtual void LoadCheck ([[maybe_unused]] CompanyProperties *object) const
 
void LoadCheck (void *object) const override
 
virtual void FixPointers ([[maybe_unused]] CompanyProperties *object) const
 
void FixPointers (void *object) const override
 
- Public Member Functions inherited from SaveLoadHandler
virtual void Save ([[maybe_unused]] void *object) const
 Save the object to disk. More...
 
virtual void Load ([[maybe_unused]] void *object) const
 Load the object from disk. More...
 
virtual void LoadCheck ([[maybe_unused]] void *object) const
 Similar to load, but used only to validate savegames. More...
 
virtual void FixPointers ([[maybe_unused]] void *object) const
 A post-load callback to fix SL_REF integers into pointers. More...
 
virtual SaveLoadTable GetDescription () const =0
 Get the description of the fields in the savegame.
 
virtual SaveLoadCompatTable GetCompatDescription () const =0
 Get the pre-header description of the fields in the savegame.
 
SaveLoadTable GetLoadDescription () const
 Get the description for how to load the chunk. More...
 

Static Public Attributes

static const SaveLoad description []
 
const static SaveLoadCompatTable compat_description = _company_economy_compat
 

Additional Inherited Members

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

Detailed Description

Definition at line 320 of file company_sl.cpp.

Field Documentation

◆ description

const SaveLoad SlCompanyEconomy::description[]
inlinestatic
Initial value:
= {
SLE_CONDVAR(CompanyEconomyEntry, income, SLE_FILE_I32 | SLE_VAR_I64, SL_MIN_VERSION, SLV_2),
SLE_CONDVAR(CompanyEconomyEntry, expenses, SLE_FILE_I32 | SLE_VAR_I64, SL_MIN_VERSION, SLV_2),
SLE_CONDVAR(CompanyEconomyEntry, company_value, SLE_FILE_I32 | SLE_VAR_I64, SL_MIN_VERSION, SLV_2),
SLE_CONDVAR(CompanyEconomyEntry, company_value, SLE_INT64, SLV_2, SL_MAX_VERSION),
SLE_CONDVAR(CompanyEconomyEntry, delivered_cargo[NUM_CARGO - 1], SLE_INT32, SL_MIN_VERSION, SLV_170),
SLE_CONDARR(CompanyEconomyEntry, delivered_cargo, SLE_UINT32, 32, SLV_170, SLV_EXTEND_CARGOTYPES),
SLE_VAR(CompanyEconomyEntry, performance_history, SLE_INT32),
}

Definition at line 322 of file company_sl.cpp.


The documentation for this class was generated from the following file:
SLE_CONDARR
#define SLE_CONDARR(base, variable, type, length, from, to)
Storage of a fixed-size array of SL_VAR elements in some savegame versions.
Definition: saveload.h:889
SL_MIN_VERSION
@ SL_MIN_VERSION
First savegame version.
Definition: saveload.h:31
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:857
CompanyEconomyEntry
Statistics about the economy.
Definition: company_base.h:24
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:391
SLV_170
@ SLV_170
170 23826
Definition: saveload.h:247
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:971
SLV_2
@ SLV_2
2.0 0.3.0 2.1 0.3.1, 0.3.2
Definition: saveload.h:34
SLV_EXTEND_CARGOTYPES
@ SLV_EXTEND_CARGOTYPES
199 PR#6802 Extend cargotypes to 64
Definition: saveload.h:282
NUM_CARGO
static const CargoID NUM_CARGO
Maximum number of cargo types in a game.
Definition: cargo_type.h:74