implement options

This commit is contained in:
Eduardo Bart
2011-11-16 22:12:11 -02:00
parent b913381d2f
commit 69ae043001
6 changed files with 76 additions and 103 deletions

View File

@@ -31,6 +31,7 @@ public:
bool load(const std::string& file);
bool save();
bool exists(const std::string& key) { return m_confsMap.find(key) != m_confsMap.end(); }
void set(const std::string& key, const std::string& value) { m_confsMap[key] = value; }
std::string get(const std::string& key) { return m_confsMap[key]; }

View File

@@ -154,6 +154,7 @@ void LuaInterface::registerFunctions()
g_lua.registerClass<Configs>();
g_lua.bindClassStaticFunction<Configs>("set", std::bind(&Configs::set, &g_configs, _1, _2));
g_lua.bindClassStaticFunction<Configs>("get", std::bind(&Configs::get, &g_configs, _1));
g_lua.bindClassStaticFunction<Configs>("exists", std::bind(&Configs::exists, &g_configs, _1));
// Logger
g_lua.registerClass<Logger>();
@@ -170,5 +171,6 @@ void LuaInterface::registerFunctions()
g_lua.bindGlobalFunction("addEvent", std::bind(&EventDispatcher::addEvent, &g_dispatcher, _1, false));
g_lua.bindGlobalFunction("scheduleEvent", std::bind(&EventDispatcher::scheduleEvent, &g_dispatcher, _1, _2));
g_lua.bindGlobalFunction("getMouseCursorPos", std::bind(&Platform::getMouseCursorPos, &g_platform));
g_lua.bindGlobalFunction("setVerticalSync", std::bind(&Platform::setVerticalSync, &g_platform, _1));
g_lua.bindGlobalFunction("getScreenSize", std::bind(&Graphics::getScreenSize, &g_graphics));
}