Initial Commit

This commit is contained in:
Rebekah 2020-08-04 13:37:07 -04:00
parent aa94ad2d29
commit d87977e608

View File

@ -1,16 +1,21 @@
#include <variant>
#include "ui/command.hpp"
#pragma once
namespace nekohook::setting {
template<typename T>
class Var;
using StrEnum = std::initializer_list<std::string_view>;
using TreeMap = StrEnum;
class Var {
class BaseVar {
public:
Var(TreeMap _tree_map, std::string_view gui_name);
BaseVar(TreeMap _tree_map, std::string_view gui_name);
enum class Type {
kBool,
kInt,
@ -30,10 +35,16 @@ public:
virtual std::string GetString() = 0; // Used by cfg mgr and gui
virtual void SetString(std::string_view) = 0;
private:
static inline std::vector<Var*> list;
static inline std::vector<std::variant<Var<bool>*, Var<int>*, Var<float>*, >> list;
public:
static inline const auto& GetList() { return list; }
};
template<typename T>
class Var {
public:
Var(TreeMap, std::string_view _gui_name, T _defaults);
};
}