OpenTTD Source 20241224-master-gee860a5c8e
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:
= {
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),
}
#define SLE_REF(base, variable, type)
Storage of a reference in every version of a savegame.
Definition saveload.h:1019
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:868
@ SLV_181
181 25012
Definition saveload.h:260
@ SL_MAX_VERSION
Highest possible saveload version.
Definition saveload.h:399
@ REF_VEHICLE
Load/save a reference to a vehicle.
Definition saveload.h:602
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:1002
Helper class to perform the cargo payment.

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),
}
@ SLV_65
65 10210
Definition saveload.h:121
@ SLV_126
126 17433
Definition saveload.h:194
@ SL_MIN_VERSION
First savegame version.
Definition saveload.h:31
@ SLV_102
102 14332
Definition saveload.h:165
@ SLV_70
70 10541
Definition saveload.h:127
Data of the economy.

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.