OpenTTD
Functions | Variables
economy_sl.cpp File Reference

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

#include "../stdafx.h"
#include "../economy_func.h"
#include "../economy_base.h"
#include "saveload.h"
#include "../safeguards.h"

Go to the source code of this file.

Functions

static void Load_PRIC ()
 Prices in pre 126 savegames.
 
static void Load_CAPR ()
 Cargo payment rates in pre 126 savegames.
 
static void Save_ECMY ()
 Economy variables.
 
static void Load_ECMY ()
 Economy variables.
 
static void Save_CAPY ()
 
static void Load_CAPY ()
 
static void Ptrs_CAPY ()
 

Variables

static const SaveLoad _economy_desc []
 
static const SaveLoad _cargopayment_desc []
 
const ChunkHandler _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, 181, SL_MAX_VERSION),
}
#define SLE_REF(base, variable, type)
Storage of a reference in every version of a savegame.
Definition: saveload.h:304
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:246
#define SL_MAX_VERSION
Highest possible savegame version.
Definition: saveload.h:96
Helper class to perform the cargo payment.
Definition: economy_base.h:26
Load/save a reference to a vehicle.
Definition: saveload.h:82
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296

Definition at line 67 of file economy_sl.cpp.

◆ _economy_chunk_handlers

const ChunkHandler _economy_chunk_handlers[]
Initial value:
= {
{ 'CAPY', Save_CAPY, Load_CAPY, Ptrs_CAPY, NULL, CH_ARRAY},
{ 'PRIC', NULL, Load_PRIC, NULL, NULL, CH_RIFF | CH_AUTO_LENGTH},
{ 'CAPR', NULL, Load_CAPR, NULL, NULL, CH_RIFF | CH_AUTO_LENGTH},
{ 'ECMY', Save_ECMY, Load_ECMY, NULL, NULL, CH_RIFF | CH_LAST},
}
static void Load_ECMY()
Economy variables.
Definition: economy_sl.cpp:61
static void Load_CAPR()
Cargo payment rates in pre 126 savegames.
Definition: economy_sl.cpp:30
static void Save_ECMY()
Economy variables.
Definition: economy_sl.cpp:55
static void Load_PRIC()
Prices in pre 126 savegames.
Definition: economy_sl.cpp:21
Last chunk in this array.
Definition: saveload.h:104

◆ _economy_desc

const SaveLoad _economy_desc[]
static
Initial value:
= {
SLE_CONDNULL(4, 0, 64),
SLE_CONDNULL(8, 65, 143),
SLE_CONDVAR(Economy, old_max_loan_unround, SLE_FILE_I32 | SLE_VAR_I64, 0, 64),
SLE_CONDVAR(Economy, old_max_loan_unround, SLE_INT64, 65, 125),
SLE_CONDVAR(Economy, old_max_loan_unround_fract, SLE_UINT16, 70, 125),
SLE_CONDVAR(Economy, inflation_prices, SLE_UINT64, 126, SL_MAX_VERSION),
SLE_CONDVAR(Economy, inflation_payment, SLE_UINT64, 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, 102, SL_MAX_VERSION),
}
#define SLE_CONDNULL(length, from, to)
Empty space in some savegame versions.
Definition: saveload.h:344
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition: saveload.h:246
#define SL_MAX_VERSION
Highest possible savegame version.
Definition: saveload.h:96
Data of the economy.
Definition: economy_type.h:21
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition: saveload.h:296

Definition at line 38 of file economy_sl.cpp.