21struct PRICChunkHandler : ChunkHandler {
34struct CAPRChunkHandler : ChunkHandler {
46static const SaveLoad _economy_desc[] = {
60struct ECMYChunkHandler : ChunkHandler {
84static const SaveLoad _cargopayment_desc[] = {
91struct CAPYChunkHandler : ChunkHandler {
99 SlSetArrayIndex(cp->index);
static constexpr CargoType NUM_CARGO
Maximum number of cargo types in a game.
void StartupIndustryDailyChanges(bool init_counter)
Initialize the variables that will maintain the daily industry change system.
Base classes related to the economy.
Functions related to the economy.
Loading for economy chunks before table headers were added.
const SaveLoadCompat _economy_sl_compat[]
Original field order for _economy_desc.
const SaveLoadCompat _cargopayment_sl_compat[]
Original field order for _cargopayment_desc.
A number of safeguards to prevent using unsafe methods.
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.
void SlCopy(void *object, size_t length, VarType conv)
Copy a list of SaveLoadType::Variables to/from a savegame.
void SlErrorCorrupt(const std::string &msg)
Error handler for corrupt savegames.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
Functions/types related to saving and loading games.
@ Null
useful to write zeros in savegame.
@ I64
A 64 bit signed int.
VarFileType
The types/structures of data that can be stored in the file.
@ I32
A 32 bit signed int.
@ I64
A 64 bit signed int.
@ U16
A 16 bit unsigned int.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
@ Vehicle
Load/save a reference to a vehicle.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
#define SLE_REF(base, variable, type)
Storage of a reference in every version of a savegame.
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
bool IsSavegameVersionBefore(SaveLoadVersion major, uint8_t minor=0)
Checks whether the savegame is below major.
@ ExtendCargotypes
Saveload version: 199, GitHub pull request: 6802 Extend cargotypes to 64.
@ UnifyCurrency
Saveload version: 65, SVN revision: 10210 Make all variables related to currency 64 bits.
@ CargoReservation
Saveload version: 181, SVN revision: 25012 Persist the reservation of cargo for vehicles instead of ...
@ CumulatedInflation
Saveload version: 126, SVN revision: 17433 Store cumulated inflation, and recalculate prices/payment...
@ MinVersion
First savegame version.
@ NewGRFCargo
Saveload version: 55, SVN revision: 9638 Increase number of cargos and NewGRF control of cargos.
@ MaxVersion
Highest possible saveload version.
@ SpreadIndustryProductionChanges
Saveload version: 102, SVN revision: 14332 Spread the industry production changes over the month,...
@ CargoPaymentOverflow
Saveload version: 70, SVN revision: 10541 Fix overflow of cargo payment rates, plus preparation for ...
@ RiffToArray
Saveload version: 294, GitHub pull request: 9375 Changed many ChunkType::Riff chunks to ChunkType::A...
@ ReadOnly
Chunk is never saved.
@ Table
An Array with a header describing the elements.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition of base types and functions in a cross-platform compatible way.
Cargo payment rates in pre 126 savegames.
void Load() const override
Load the chunk.
void Save() const override
Save the chunk.
void FixPointers() const override
Fix the pointers.
void Load() const override
Load the chunk.
Helper class to perform the cargo payment.
void Load() const override
Load the chunk.
void Save() const override
Save the chunk.
Prices in pre 126 savegames.
void Load() const override
Load the chunk.
static Pool::IterateWrapper< CargoPayment > Iterate(size_t from=0)
static T * CreateAtIndex(CargoPaymentID index, Targs &&... args)
static constexpr VarType U16
Store a 16 bits unsigned int.
static constexpr VarType U8
Store a 8 bits unsigned int.
static constexpr VarType I16
Store a 16 bits signed int.
static constexpr VarType I64
Store a 64 bits signed int.
static constexpr VarType U64
Store a 64 bits unsigned int.
static constexpr VarType U32
Store a 32 bits unsigned int.