21#ifndef SAYONARA_PLAYER_SETTINGS_H
22#define SAYONARA_PLAYER_SETTINGS_H
24#include "Utils/Settings/SettingKey.h"
25#include "Utils/Settings/Setting.h"
26#include "Utils/Settings/SettingNotifier.h"
27#include "Utils/Singleton.h"
32#define GetSetting(x) Settings::instance()->get<x>()
33#define SetSetting(x, y) Settings::instance()->set<x>(y)
34#define ListenSetting(x, y) Set::listen<x>(this, &y)
35#define ListenSettingNoCall(x, y) Set::listen<x>(this, &y, false)
37using SettingArray = std::array<AbstrSetting*, static_cast<unsigned int>(SettingKey::Num_Setting_Keys)>;
45 [[nodiscard]]
AbstrSetting* setting(SettingKey keyIndex)
const;
47 const SettingArray& settings();
53 template<
typename KeyClass>
54 const typename KeyClass::Data& get()
const
57 auto* s =
static_cast<SettingPtr
>(setting(KeyClass::key));
62 template<
typename KeyClass>
63 void set(
const typename KeyClass::Data& val)
66 auto* s =
static_cast<SettingPtr
>(setting(KeyClass::key));
68 if(s->assignValue(val))
74 template<
typename KeyClass>
78 settingNotifier->valueChanged();
Definition SettingNotifier.h:50