mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue