OpenTTD Source: SlCompanyEconomy Class Reference

OpenTTD Source 13.2.1

Public Member Functions | Static Public Attributes
SlCompanyEconomy Class Reference
Inheritance diagram for SlCompanyEconomy:

## 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. More...
void | Load (void *object) const override
| Load the object from disk. More...
void | LoadCheck (void *object) const override
| Similar to load, but used only to validate savegames. More...
void | FixPointers (void *object) const override
| A post-load callback to fix SL_REF integers into pointers. More...
Public Member Functions inherited from SaveLoadHandler
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 319 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, income, SLE_INT64, SLV_2, SL_MAX_VERSION),
SLE_CONDVAR(CompanyEconomyEntry, expenses, SLE_FILE_I32 | SLE_VAR_I64, SL_MIN_VERSION, SLV_2),
SLE_CONDVAR(CompanyEconomyEntry, expenses, SLE_INT64, SLV_2, SL_MAX_VERSION),
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_CONDARR(CompanyEconomyEntry, delivered_cargo, SLE_UINT32, NUM_CARGO, SLV_EXTEND_CARGOTYPES, SL_MAX_VERSION),
SLE_VAR(CompanyEconomyEntry, performance_history, SLE_INT32),
}

Definition at line 321 of file company_sl.cpp.

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

- src/saveload/company_sl.cpp

SL_MIN_VERSION
@ SL_MIN_VERSION
First savegame version.
Definition: saveload.h:35
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:729
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:708
CompanyEconomyEntry
Statistics about the economy.
Definition: company_base.h:23
SLV_EXTEND_CARGOTYPES
@ SLV_EXTEND_CARGOTYPES
199 PR#6802 Extend cargotypes to 64
Definition: saveload.h:286
SLV_170
@ SLV_170
170 23826
Definition: saveload.h:251
SLV_2
@ SLV_2
2.0 0.3.0 2.1 0.3.1, 0.3.2
Definition: saveload.h:38
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:348
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:778
NUM_CARGO
@ NUM_CARGO
Maximal number of cargo types in a game.
Definition: cargo_type.h:65