OpenTTD Source: NullSettingDesc Struct Reference

OpenTTD Source 14.0-RC3

Public Member Functions
NullSettingDesc Struct Reference

Placeholder for settings that have been removed, but might still linger in the savegame. More...

`#include <settings_internal.h>`

Inheritance diagram for NullSettingDesc:

## Public Member Functions
| NullSettingDesc (const SaveLoad &save)
std::string | FormatValue (const void *) const override
| Format the value of the setting associated with this object. More...
void | ParseValue (const IniItem *, void *) const override
| Parse/read the value from the Ini item into the setting associated with this object. More...
bool | IsSameValue (const IniItem *, void *) const override
| Check whether the value in the Ini item is the same as is saved in this setting in the object. More...
bool | IsDefaultValue (void *) const override
| Check whether the value is the same as the default value. More...
void | ResetToDefault (void *) const override
| Reset the setting to its default value.
Public Member Functions inherited from SettingDesc
| SettingDesc (const SaveLoad &save, SettingFlag flags, bool startup)
bool | IsEditable (bool do_command=false) const
| Check whether the setting is editable in the current gamemode. More...
SettingType | GetType () const
| Return the type of the setting. More...
constexpr const std::string & | GetName () const
| Get the name of this setting. More...
virtual bool | IsIntSetting () const
| Check whether this setting is an integer type setting. More...
virtual bool | IsStringSetting () const
| Check whether this setting is an string type setting. More...
const struct IntSettingDesc * | AsIntSetting () const
| Get the setting description of this setting as an integer setting. More...
const struct StringSettingDesc * | AsStringSetting () const
| Get the setting description of this setting as a string setting. More...

## Additional Inherited Members
Data Fields inherited from SettingDesc
SettingFlag | flags
| Handles how a setting would show up in the GUI (text/currency, etc.).
bool | startup
| Setting has to be loaded directly at startup?.
SaveLoad | save
| Internal structure (going to savegame, parts to config).

## Detailed Description

Placeholder for settings that have been removed, but might still linger in the savegame.

Definition at line 364 of file settings_internal.h.

## Member Function Documentation

## ◆ FormatValue()

std::string NullSettingDesc::FormatValue | ( | const void * | object | ) | const
| inlineoverridevirtual

Format the value of the setting associated with this object.

Parameters

  buf | The before of the buffer to format into.
  last | The end of the buffer to format into.
  object | The object the setting is in.

Implements SettingDesc.

Definition at line 368 of file settings_internal.h.

## ◆ IsDefaultValue()

bool NullSettingDesc::IsDefaultValue | ( | void * | object | ) | const
| inlineoverridevirtual

Check whether the value is the same as the default value.

Parameters

  object | The object the setting is in.

Returns
  true iff the value is the default value.

Implements SettingDesc.

Definition at line 371 of file settings_internal.h.

## ◆ IsSameValue()

bool NullSettingDesc::IsSameValue | ( | const IniItem * | item,
|  | void * | object
| ) |  | const
| inlineoverridevirtual

Check whether the value in the Ini item is the same as is saved in this setting in the object.

It might be that determining whether the value is the same is way more expensive than just writing the value. In those cases this function may unconditionally return false even though the value might be the same as in the Ini item.

Parameters

  item | The Ini item with the content of this setting.
  object | The object the setting is in.

Returns
  True if the value is definitely the same (might be false when the same).

Implements SettingDesc.

Definition at line 370 of file settings_internal.h.

## ◆ ParseValue()

void NullSettingDesc::ParseValue | ( | const IniItem * | item,
|  | void * | object
| ) |  | const
| inlineoverridevirtual

Parse/read the value from the Ini item into the setting associated with this object.

Parameters

  item | The Ini item with the content of this setting.
  object | The object the setting is in.

Implements SettingDesc.

Definition at line 369 of file settings_internal.h.

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

- src/settings_internal.h