OpenTTD Source  20240919-master-gdf0233f4c2
economy_sl.cpp File Reference
#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:
= {
SLE_VAR(CargoPayment, route_profit, SLE_INT64),
SLE_VAR(CargoPayment, visual_profit, SLE_INT64),
SLE_CONDVAR(CargoPayment, visual_transfer, SLE_INT64, SLV_181, SL_MAX_VERSION),
}

Definition at line 84 of file economy_sl.cpp.

◆ _economy_desc

const SaveLoad _economy_desc[]
static
Initial value:
= {
SLE_CONDVAR(Economy, old_max_loan_unround, SLE_FILE_I32 | SLE_VAR_I64, SL_MIN_VERSION, SLV_65),
SLE_CONDVAR(Economy, old_max_loan_unround, SLE_INT64, SLV_65, SLV_126),
SLE_CONDVAR(Economy, old_max_loan_unround_fract, SLE_UINT16, SLV_70, SLV_126),
SLE_CONDVAR(Economy, inflation_prices, SLE_UINT64, SLV_126, SL_MAX_VERSION),
SLE_CONDVAR(Economy, inflation_payment, SLE_UINT64, SLV_126, SL_MAX_VERSION),
SLE_VAR(Economy, fluct, SLE_INT16),
SLE_VAR(Economy, interest_rate, SLE_UINT8),
SLE_VAR(Economy, infl_amount, SLE_UINT8),
SLE_VAR(Economy, infl_amount_pr, SLE_UINT8),
SLE_CONDVAR(Economy, industry_daily_change_counter, SLE_UINT32, SLV_102, SL_MAX_VERSION),
}

Definition at line 46 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.

SLV_70
@ SLV_70
70 10541
Definition: saveload.h:127
SL_MIN_VERSION
@ SL_MIN_VERSION
First savegame version.
Definition: saveload.h:31
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:857
SLE_REF
#define SLE_REF(base, variable, type)
Storage of a reference in every version of a savegame.
Definition: saveload.h:988
SLV_102
@ SLV_102
102 14332
Definition: saveload.h:165
CargoPayment
Helper class to perform the cargo payment.
Definition: economy_base.h:24
SLV_65
@ SLV_65
65 10210
Definition: saveload.h:121
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition: saveload.h:391
REF_VEHICLE
@ REF_VEHICLE
Load/save a reference to a vehicle.
Definition: saveload.h:594
SLV_181
@ SLV_181
181 25012
Definition: saveload.h:260
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:971
Economy
Data of the economy.
Definition: economy_type.h:43
SLV_126
@ SLV_126
126 17433
Definition: saveload.h:194