15#include "../economy_func.h"
16#include "../economy_base.h"
18#include "../safeguards.h"
46static const SaveLoad _economy_desc[] = {
84static const SaveLoad _cargopayment_desc[] = {
99 SlSetArrayIndex(cp->index);
static const CargoID 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.
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.
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 SL_VARs 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.
@ SLE_VAR_NULL
useful to write zeros in savegame.
@ CH_READONLY
Chunk is never saved.
std::reference_wrapper< const ChunkHandler > ChunkHandlerRef
A reference to ChunkHandler.
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.
@ SLV_EXTEND_CARGOTYPES
199 PR#6802 Extend cargotypes to 64
@ SLV_RIFF_TO_ARRAY
294 PR#9375 Changed many CH_RIFF chunks to CH_ARRAY chunks.
@ SL_MAX_VERSION
Highest possible saveload version.
@ SL_MIN_VERSION
First savegame version.
@ REF_VEHICLE
Load/save a reference to a vehicle.
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
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.
Handlers and description of chunk.
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< Titem > Iterate(size_t from=0)
Returns an iterable ensemble of all valid Titem.