OpenTTD Source: SaveLoad Struct Reference

OpenTTD Source 15.3

Data Fields
SaveLoad Struct Reference

SaveLoad type struct. More...

`#include <saveload.h>`

## Data Fields
std::string | name
| Name of this field (optional, used for tables).
SaveLoadType | cmd
| The action to take with the saved/loaded type, All types need different action.
VarType | conv
| Type of the variable to be saved; this field combines both FileVarType and MemVarType.
uint16_t | length
| (Conditional) length of the variable (eg. arrays) (max array size is 65536 elements).
SaveLoadVersion | version_from
| Save/load the variable starting from this savegame version.
SaveLoadVersion | version_to
| Save/load the variable before this savegame version.
SaveLoadAddrProc * | address_proc
| Callback proc the get the actual variable address in memory.
size_t | extra_data
| Extra data for the callback proc.
std::shared_ptr< SaveLoadHandler > | handler
| Custom handler for Save/Load procs.

## Detailed Description

SaveLoad type struct.

Do NOT use this directly but use the SLE_ macros defined just below!

Definition at line 732 of file saveload.h.

## Field Documentation

## ◆ address_proc

SaveLoadAddrProc* SaveLoad::address_proc

Callback proc the get the actual variable address in memory.

Definition at line 739 of file saveload.h.

Referenced by GetVariableAddress().

## ◆ cmd

SaveLoadType SaveLoad::cmd

The action to take with the saved/loaded type, All types need different action.

Definition at line 734 of file saveload.h.

Referenced by GetSavegameFileType(), GetSettingsDesc(), SlCompatTableHeader(), and SlTableHeader().

## ◆ conv

VarType SaveLoad::conv

Type of the variable to be saved; this field combines both FileVarType and MemVarType.

Definition at line 735 of file saveload.h.

Referenced by IntSettingDesc::FormatValue(), StringSettingDesc::FormatValue(), ListSettingDesc::FormatValue(), GetSavegameFileType(), GetSettingsDesc(), GetVariableAddress(), StringSettingDesc::IsSameValue(), IntSettingDesc::MakeValueValid(), ListSettingDesc::ParseValue(), IntSettingDesc::Read(), SetSettingValue(), and IntSettingDesc::Write().

## ◆ extra_data

size_t SaveLoad::extra_data

Extra data for the callback proc.

Definition at line 740 of file saveload.h.

Referenced by GetVariableAddress().

## ◆ handler

std::shared_ptr<SaveLoadHandler> SaveLoad::handler

Custom handler for Save/Load procs.

Definition at line 741 of file saveload.h.

Referenced by SlCompatTableHeader(), and SlTableHeader().

## ◆ length

uint16_t SaveLoad::length

(Conditional) length of the variable (eg. arrays) (max array size is 65536 elements).

Definition at line 736 of file saveload.h.

Referenced by ListSettingDesc::FormatValue(), GetSettingsDesc(), and ListSettingDesc::ParseValue().

## ◆ name

std::string SaveLoad::name

Name of this field (optional, used for tables).

Definition at line 733 of file saveload.h.

Referenced by SettingDesc::GetName(), SlCompatTableHeader(), and SlTableHeader().

## ◆ version_from

SaveLoadVersion SaveLoad::version_from

Save/load the variable starting from this savegame version.

Definition at line 737 of file saveload.h.

Referenced by CmdChangeSetting(), GetSaveLoadFromSettingTable(), GetSettingFromName(), GetSettingsDesc(), IniLoadSettings(), IniSaveSettings(), LoadSettings(), SlIsObjectValidInSavegame(), and SurveySettingsTable().

## ◆ version_to

SaveLoadVersion SaveLoad::version_to

Save/load the variable before this savegame version.

Definition at line 738 of file saveload.h.

Referenced by CmdChangeSetting(), GetSaveLoadFromSettingTable(), GetSettingFromName(), GetSettingsDesc(), IniLoadSettings(), IniSaveSettings(), LoadSettings(), SlIsObjectValidInSavegame(), and SurveySettingsTable().

The documentation for this struct was generated from the following file:

- src/saveload/saveload.h