OpenTTD Source
20240919-master-gdf0233f4c2
|
Go to the documentation of this file.
10 #include "../stdafx.h"
15 #include "../economy_func.h"
16 #include "../economy_base.h"
18 #include "../safeguards.h"
46 static const SaveLoad _economy_desc[] = {
84 static const SaveLoad _cargopayment_desc[] = {
99 SlSetArrayIndex(cp->index);
const SaveLoadCompat _cargopayment_sl_compat[]
Original field order for _cargopayment_desc.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
@ SL_MIN_VERSION
First savegame version.
void SlCopy(void *object, size_t length, VarType conv)
Copy a list of SL_VARs to/from a savegame.
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
void SlErrorCorrupt(const std::string &msg)
Error handler for corrupt savegames.
@ SLE_VAR_NULL
useful to write zeros in savegame.
void Load() const override
Load the chunk.
Cargo payment rates in pre 126 savegames.
Handlers and description of chunk.
#define SLE_REF(base, variable, type)
Storage of a reference in every version of a savegame.
@ CH_READONLY
Chunk is never saved.
const SaveLoadCompat _economy_sl_compat[]
Original field order for _economy_desc.
Helper class to perform the cargo payment.
void FixPointers() const override
Fix the pointers.
void Save() const override
Save the chunk.
@ SLV_RIFF_TO_ARRAY
294 PR#9375 Changed many CH_RIFF chunks to CH_ARRAY chunks.
@ SL_MAX_VERSION
Highest possible saveload version.
void Save() const override
Save the chunk.
@ REF_VEHICLE
Load/save a reference to a vehicle.
void StartupIndustryDailyChanges(bool init_counter)
Initialize the variables that will maintain the daily industry change system.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
static Pool::IterateWrapper< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.
std::span< const ChunkHandlerRef > ChunkHandlerTable
A table of ChunkHandler entries.
Prices in pre 126 savegames.
void Load() const override
Load the chunk.
@ SLV_EXTEND_CARGOTYPES
199 PR#6802 Extend cargotypes to 64
std::vector< SaveLoad > SlCompatTableHeader(const SaveLoadTable &slt, const SaveLoadCompatTable &slct)
Load a table header in a savegame compatible way.
void Load() const override
Load the chunk.
void SlObject(void *object, const SaveLoadTable &slt)
Main SaveLoad function.
bool IsSavegameVersionBefore(SaveLoadVersion major, uint8_t minor=0)
Checks whether the savegame is below major.
static const CargoID NUM_CARGO
Maximum number of cargo types in a game.
std::vector< SaveLoad > SlTableHeader(const SaveLoadTable &slt)
Save or Load a table header.
void Load() const override
Load the chunk.
int SlIterateArray()
Iterate through the elements of an array and read the whole thing.