mirror of
https://github.com/edubart/otclient.git
synced 2025-12-19 15:17:12 +01:00
reorganize sources
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
#ifndef CONFIGMANAGER_H
|
||||
#define CONFIGMANAGER_H
|
||||
|
||||
#include <global.h>
|
||||
#include "declarations.h"
|
||||
|
||||
struct ConfigValueProxy {
|
||||
ConfigValueProxy(const std::string& v) : value(v) { }
|
||||
operator std::string() const { return aux::unsafe_cast<std::string>(value); }
|
||||
operator float() const { return aux::unsafe_cast<float>(value); }
|
||||
operator int() const { return aux::unsafe_cast<int>(value); }
|
||||
operator bool() const { return aux::unsafe_cast<bool>(value); }
|
||||
operator std::string() const { return fw::unsafe_cast<std::string>(value); }
|
||||
operator float() const { return fw::unsafe_cast<float>(value); }
|
||||
operator int() const { return fw::unsafe_cast<int>(value); }
|
||||
operator bool() const { return fw::unsafe_cast<bool>(value); }
|
||||
std::string value;
|
||||
};
|
||||
|
||||
@@ -19,7 +19,7 @@ public:
|
||||
bool save();
|
||||
|
||||
template<class T>
|
||||
void set(const std::string& key, const T& value) { m_confsMap[key] = aux::unsafe_cast<std::string>(value); }
|
||||
void set(const std::string& key, const T& value) { m_confsMap[key] = fw::unsafe_cast<std::string>(value); }
|
||||
|
||||
ConfigValueProxy get(const std::string& key) { return ConfigValueProxy(m_confsMap[key]); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user