OpenTTD Source 20260721-master-g25ec12c62d
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 "../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:
= {
}
@ Vehicle
Load/save a reference to a vehicle.
Definition saveload.h:618
#define SLE_REF(base, variable, type)
Storage of a reference in every version of a savegame.
Definition saveload.h:1014
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:884
@ CargoReservation
Saveload version: 181, SVN revision: 25012 Persist the reservation of cargo for vehicles instead of ...
Definition saveload.h:264
@ MaxVersion
Highest possible saveload version.
Definition saveload.h:424
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:997
Helper class to perform the cargo payment.
static constexpr VarType I64
Store a 64 bits signed int.
Definition saveload.h:732

Definition at line 84 of file economy_sl.cpp.

◆ _economy_desc

const SaveLoad _economy_desc[]
static
Initial value:
= {
SLE_VAR(Economy, interest_rate, VarTypes::U8),
SLE_VAR(Economy, infl_amount, VarTypes::U8),
SLE_VAR(Economy, infl_amount_pr, VarTypes::U8),
}
@ I64
A 64 bit signed int.
Definition saveload.h:659
@ I32
A 32 bit signed int.
Definition saveload.h:640
@ UnifyCurrency
Saveload version: 65, SVN revision: 10210 Make all variables related to currency 64 bits.
Definition saveload.h:125
@ CumulatedInflation
Saveload version: 126, SVN revision: 17433 Store cumulated inflation, and recalculate prices/payment...
Definition saveload.h:198
@ MinVersion
First savegame version.
Definition saveload.h:34
@ SpreadIndustryProductionChanges
Saveload version: 102, SVN revision: 14332 Spread the industry production changes over the month,...
Definition saveload.h:169
@ CargoPaymentOverflow
Saveload version: 70, SVN revision: 10541 Fix overflow of cargo payment rates, plus preparation for ...
Definition saveload.h:131
Data of the economy.
static constexpr VarType U16
Store a 16 bits unsigned int.
Definition saveload.h:729
static constexpr VarType U8
Store a 8 bits unsigned int.
Definition saveload.h:727
static constexpr VarType I16
Store a 16 bits signed int.
Definition saveload.h:728
static constexpr VarType U64
Store a 64 bits unsigned int.
Definition saveload.h:733
static constexpr VarType U32
Store a 32 bits unsigned int.
Definition saveload.h:731

Definition at line 46 of file economy_sl.cpp.

◆ CAPR

const CAPRChunkHandler CAPR
static

Definition at line 126 of file economy_sl.cpp.

◆ CAPY

const CAPYChunkHandler CAPY
static

Definition at line 124 of file economy_sl.cpp.

◆ ECMY

const ECMYChunkHandler ECMY
static

Definition at line 127 of file economy_sl.cpp.

◆ economy_chunk_handlers

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

Definition at line 128 of file economy_sl.cpp.

◆ PRIC

const PRICChunkHandler PRIC
static

Definition at line 125 of file economy_sl.cpp.