#pragma once #include "serializer.h" class Settings : public Serializer::Descriptor { public: Settings() { class_id = "pref"; } static Settings I; static bool load(); static bool save(); static bool has(const std::string& key) { return I.Descriptor::has(key); } template static void set(const std::string& key, const T value) { I.Descriptor::set(key, value); } template static std::shared_ptr get(const std::string& key) { return I.Descriptor::get(key); } template static void value(const std::string& key, D& dest) { I.Descriptor::value(key, dest); } template static auto value(const std::string& key) { return I.Descriptor::value(key); } template static D value_or(const std::string& key, D def) { return I.Descriptor::value_or(key, def); } };