forked from faggotman69/Prometheus
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathConfiguration.hpp
More file actions
56 lines (49 loc) · 951 Bytes
/
Configuration.hpp
File metadata and controls
56 lines (49 loc) · 951 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#pragma once
#include <vector>
#include "Interfaces.h"
template <typename T>
class ConfigItem
{
std::string category, name;
T* value;
public:
ConfigItem(std::string category, std::string name, T* value)
{
this->category = category;
this->name = name;
this->value = value;
}
};
template <typename T>
class ConfigValue
{
public:
ConfigValue(std::string category_, std::string name_, T* value_)
{
category = category_;
name = name_;
value = value_;
}
std::string category, name;
T* value;
};
class CConfig
{
protected:
std::vector<ConfigValue<int>*> ints;
std::vector<ConfigValue<bool>*> bools;
std::vector<ConfigValue<float>*> floats;
private:
void SetupValue(int&, int, std::string, std::string);
void SetupValue(bool&, bool, std::string, std::string);
void SetupValue(float&, float, std::string, std::string);
public:
CConfig()
{
Setup();
}
void Setup();
void Save();
void Load();
};
extern CConfig* Config;