mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
ugly, refactor required
This commit is contained in:
parent
d47193cbb3
commit
e456b77143
8 changed files with 81 additions and 35 deletions
|
|
@ -32,6 +32,15 @@ dynamic::Value SettingsHandler::getValue(const std::string& name) const {
|
|||
}
|
||||
}
|
||||
|
||||
std::string SettingsHandler::toString(const std::string& name) const {
|
||||
auto found = map.find(name);
|
||||
if (found == map.end()) {
|
||||
throw std::runtime_error("setting '"+name+"' does not exist");
|
||||
}
|
||||
auto setting = found->second;
|
||||
return setting->toString();
|
||||
}
|
||||
|
||||
void SettingsHandler::setValue(const std::string& name, dynamic::Value value) {
|
||||
auto found = map.find(name);
|
||||
if (found == map.end()) {
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ public:
|
|||
|
||||
dynamic::Value getValue(const std::string& name) const;
|
||||
void setValue(const std::string& name, dynamic::Value value);
|
||||
std::string toString(const std::string& name) const;
|
||||
};
|
||||
|
||||
extern std::string write_controls();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue