OpenTTD Source 20241224-master-gf74b0cf984
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.
 
void Save (void *object) const override
 Save the object to disk.
 
void Load (void *object) const override
 Load the object from disk.
 
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 const SaveLoad description []
 
static const 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.

Member Function Documentation

◆ FixPointers()

void SlCompanyEconomy::FixPointers ( CompanyProperties c) const
inlineoverridevirtual

Reimplemented from DefaultSaveLoadHandler< SlCompanyEconomy, CompanyProperties >.

Definition at line 347 of file company_sl.cpp.

◆ Load()

void SlCompanyEconomy::Load ( CompanyProperties c) const
inlineoverridevirtual

Reimplemented from DefaultSaveLoadHandler< SlCompanyEconomy, CompanyProperties >.

Definition at line 342 of file company_sl.cpp.

◆ LoadCheck()

void SlCompanyEconomy::LoadCheck ( CompanyProperties c) const
inlineoverridevirtual

Reimplemented from DefaultSaveLoadHandler< SlCompanyEconomy, CompanyProperties >.

Definition at line 352 of file company_sl.cpp.

◆ Save()

void SlCompanyEconomy::Save ( CompanyProperties c) const
inlineoverridevirtual

Reimplemented from DefaultSaveLoadHandler< SlCompanyEconomy, CompanyProperties >.

Definition at line 337 of file company_sl.cpp.

Field Documentation

◆ compat_description

const SaveLoadCompatTable SlCompanyEconomy::compat_description = _company_economy_compat
inlinestatic

Definition at line 335 of file company_sl.cpp.

◆ 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),
}
static const CargoID NUM_CARGO
Maximum number of cargo types in a game.
Definition cargo_type.h:74
#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:900
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:868
@ SLV_EXTEND_CARGOTYPES
199 PR#6802 Extend cargotypes to 64
Definition saveload.h:282
@ SLV_170
170 23826
Definition saveload.h:247
@ SL_MAX_VERSION
Highest possible saveload version.
Definition saveload.h:399
@ SL_MIN_VERSION
First savegame version.
Definition saveload.h:31
@ SLV_2
2.0 0.3.0 2.1 0.3.1, 0.3.2
Definition saveload.h:34
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:1002
Statistics about the economy.

Definition at line 322 of file company_sl.cpp.


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