OpenTTD Source 20260917-master-gec444f7315
economy_sl.cpp File Reference

Code handling saving and loading of economy data. More...

#include "../stdafx.h"
#include "saveload.h"
#include "compat/economy_sl_compat.h"
#include "../economy_func.h"
#include "../economy_base.h"
#include "../vehicle_base.h"
#include "../safeguards.h"

Go to the source code of this file.

Data Structures

struct  PRICChunkHandler
 Prices in pre 126 savegames. More...
struct  CAPRChunkHandler
 Cargo payment rates in pre 126 savegames. More...
struct  ECMYChunkHandler
 Economy variables. More...
struct  CAPYChunkHandler

Functions

const ChunkHandlerTable _economy_chunk_handlers (economy_chunk_handlers)

Variables

static const SaveLoad _economy_desc []
static const SaveLoad _cargopayment_desc []
static const CAPYChunkHandler CAPY
static const PRICChunkHandler PRIC
static const CAPRChunkHandler CAPR
static const ECMYChunkHandler ECMY
static const ChunkHandlerRef economy_chunk_handlers []

Detailed Description

Code handling saving and loading of economy data.

Definition in file economy_sl.cpp.

Variable Documentation

◆ _cargopayment_desc

const SaveLoad _cargopayment_desc[]
static
Initial value:
= {
}
#define SLE_OBJECT_ADDRESS(base, variable)
Macro to be able to pass the variable type and construct the SaveLoad::AddressFunction given a base c...
Definition saveload.h:754
@ CargoReservation
Saveload version: 181, SVN revision: 25012 Persist the reservation of cargo for vehicles instead of ...
Definition saveload.h:267
Helper class to perform the cargo payment.
static SaveLoad Variable(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion, size_t extra=0)
Storage of a variable in some savegame versions.
Definition saveload.h:926
static SaveLoad Reference(std::string name, AddressFunction< T > address_func, SaveLoadVersion from=SaveLoadVersion::MinVersion, SaveLoadVersion to=SaveLoadVersion::MaxVersion)
Storage of a reference to a pool element in some savegame versions.
Definition saveload.h:951

Definition at line 83 of file economy_sl.cpp.

◆ _economy_desc

const SaveLoad _economy_desc[]
static
Initial value:
= {
SaveLoad::Variable<VarFileType::U8>("infl_amount_pr", SLE_OBJECT_ADDRESS(Economy, infl_amount_pr)),
}
@ UnifyCurrency
Saveload version: 65, SVN revision: 10210 Make all variables related to currency 64 bits.
Definition saveload.h:128
@ CumulatedInflation
Saveload version: 126, SVN revision: 17433 Store cumulated inflation, and recalculate prices/payment...
Definition saveload.h:201
@ MinVersion
First savegame version.
Definition saveload.h:37
@ SpreadIndustryProductionChanges
Saveload version: 102, SVN revision: 14332 Spread the industry production changes over the month,...
Definition saveload.h:172
@ CargoPaymentOverflow
Saveload version: 70, SVN revision: 10541 Fix overflow of cargo payment rates, plus preparation for ...
Definition saveload.h:134
Data of the economy.

Definition at line 45 of file economy_sl.cpp.

◆ CAPR

const CAPRChunkHandler CAPR
static

Definition at line 125 of file economy_sl.cpp.

◆ CAPY

const CAPYChunkHandler CAPY
static

Definition at line 123 of file economy_sl.cpp.

◆ ECMY

const ECMYChunkHandler ECMY
static

Definition at line 126 of file economy_sl.cpp.

◆ economy_chunk_handlers

const ChunkHandlerRef economy_chunk_handlers[]
static
Initial value:
= {
CAPY,
PRIC,
CAPR,
ECMY,
}

Definition at line 127 of file economy_sl.cpp.

◆ PRIC

const PRICChunkHandler PRIC
static

Definition at line 124 of file economy_sl.cpp.