21 #ifndef SAYONARA_SETTINGS_H_
22 #define SAYONARA_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"
31 #define GetSetting(x) Settings::instance()->get<x>()
32 #define SetSetting(x, y) Settings::instance()->set<x>(y)
33 #define ListenSetting(x, y) Set::listen<x>(this, &y)
34 #define ListenSettingNoCall(x, y) Set::listen<x>(this, &y, false)
36 using SettingArray=std::array<AbstrSetting*, static_cast<unsigned int>(SettingKey::Num_Setting_Keys)>;
51 const SettingArray& settings();
60 template<
typename KeyClass>
61 const typename KeyClass::Data& get()
const
64 SettingPtr s =
static_cast<SettingPtr
>( setting(KeyClass::key) );
69 template<
typename KeyClass>
70 void set(
const typename KeyClass::Data& val)
73 SettingPtr s =
static_cast<SettingPtr
>( setting(KeyClass::key) );
75 if( s->assignValue(val))
83 template<
typename KeyClass>
94 #endif // SAYONARA_SETTINGS_H_