OpenTTD Source: src/saveload/subsidy_sl.cpp File Reference

OpenTTD Source 15.0-RC2

Data Structures | Functions | Variables
subsidy_sl.cpp File Reference

Code handling saving and loading of subsidies. More...

`#include "../stdafx.h"`
`#include "saveload.h"`
`#include "compat/subsidy_sl_compat.h"`
`#include "../subsidy_base.h"`
`#include "../safeguards.h"`

Go to the source code of this file.

## Data Structures
struct | SUBSChunkHandler

## Functions
const ChunkHandlerTable | _subsidy_chunk_handlers (subsidy_chunk_handlers)

## Variables
static const SaveLoad | _subsidies_desc []
static const SUBSChunkHandler | SUBS
static const ChunkHandlerRef | subsidy_chunk_handlers []

## Detailed Description

Code handling saving and loading of subsidies.

Definition in file subsidy_sl.cpp.

## Variable Documentation

## ◆ _subsidies_desc

const SaveLoad _subsidies_desc[]
| static

Initial value:
= {
SLE_VAR(Subsidy, cargo_type, SLE_UINT8),
SLE_CONDVAR(Subsidy, remaining, SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_CUSTOM_SUBSIDY_DURATION),
SLE_CONDVAR(Subsidy, remaining, SLE_UINT16, SLV_CUSTOM_SUBSIDY_DURATION, SL_MAX_VERSION),
SLE_CONDVAR(Subsidy, awarded, SLE_UINT8, SLV_125, SL_MAX_VERSION),
SLE_CONDVARNAME(Subsidy, src.type, "src_type", SLE_UINT8, SLV_125, SL_MAX_VERSION),
SLE_CONDVARNAME(Subsidy, dst.type, "dst_type", SLE_UINT8, SLV_125, SL_MAX_VERSION),
SLE_CONDVARNAME(Subsidy, src.id, "src", SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_5),
SLE_CONDVARNAME(Subsidy, src.id, "src", SLE_UINT16, SLV_5, SL_MAX_VERSION),
SLE_CONDVARNAME(Subsidy, dst.id, "dst", SLE_FILE_U8 | SLE_VAR_U16, SL_MIN_VERSION, SLV_5),
SLE_CONDVARNAME(Subsidy, dst.id, "dst", SLE_UINT16, SLV_5, SL_MAX_VERSION),
}
SLE_CONDVAR
#define SLE_CONDVAR(base, variable, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:883
SLV_CUSTOM_SUBSIDY_DURATION
@ SLV_CUSTOM_SUBSIDY_DURATION
292 PR#9081 Configurable subsidy duration.
Definition saveload.h:330
SLV_125
@ SLV_125
125 17113
Definition saveload.h:193
SL_MAX_VERSION
@ SL_MAX_VERSION
Highest possible saveload version.
Definition saveload.h:416
SL_MIN_VERSION
@ SL_MIN_VERSION
First savegame version.
Definition saveload.h:31
SLV_5
@ SLV_5
5.0 1429 5.1 1440 5.2 1525 0.3.6
Definition saveload.h:43
SLE_VAR
#define SLE_VAR(base, variable, type)
Storage of a variable in every version of a savegame.
Definition saveload.h:1017
SLE_CONDVARNAME
#define SLE_CONDVARNAME(base, variable, name, type, from, to)
Storage of a variable in some savegame versions.
Definition saveload.h:894
Subsidy
Struct about subsidies, offered and awarded.
Definition subsidy_base.h:23

Definition at line 19 of file subsidy_sl.cpp.

## ◆ SUBS

const SUBSChunkHandler SUBS
| static

Definition at line 57 of file subsidy_sl.cpp.

## ◆ subsidy_chunk_handlers

const ChunkHandlerRef subsidy_chunk_handlers[]
| static

Initial value:
= {
SUBS,
}

Definition at line 58 of file subsidy_sl.cpp.