Codechange: use initializer_lists for the settings tables

Not using vectors as those require copying from the initializer list and that
makes unique_ptrs to the actual SettingDesc objects later impossible.
This commit is contained in:
rubidium42
2021-05-18 21:01:42 +02:00
committed by rubidium42
parent 425d50372f
commit 3bb6ce8827
11 changed files with 107 additions and 117 deletions

View File

@@ -107,6 +107,8 @@ struct SettingDesc : SettingDescBase {
SettingType GetType() const;
};
typedef std::initializer_list<const SettingDesc> SettingTable;
const SettingDesc *GetSettingFromName(const char *name);
bool SetSettingValue(const SettingDesc *sd, int32 value, bool force_newgame = false);
bool SetSettingValue(const SettingDesc *sd, const char *value, bool force_newgame = false);