Codechange: access the name of a setting via an accessor function

This commit is contained in:
Rubidium
2021-07-08 19:20:41 +02:00
committed by rubidium42
parent 94881f5a34
commit 01139d3368
4 changed files with 34 additions and 23 deletions

View File

@@ -74,7 +74,9 @@ struct SettingDesc {
name(name), flags(flags), startup(startup), save(save) {}
virtual ~SettingDesc() {}
private:
std::string name; ///< Name of the setting. Used in configuration file and for console.
public:
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).
@@ -82,6 +84,15 @@ struct SettingDesc {
bool IsEditable(bool do_command = false) const;
SettingType GetType() const;
/**
* Get the name of this setting.
* @return The name of the setting.
*/
constexpr const std::string &GetName() const
{
return this->name;
}
/**
* Check whether this setting is an integer type setting.
* @return True when the underlying type is an integer.