#ifndef LUA_MANAGER_H #define LUA_MANAGER_H #include #include #include #include #include namespace gameBase{ class LuaManager{ public: struct Index{ std::string index; bool string; Index(std::string index){ this->index = index; this->string = true; } Index(int index){ this->index = std::to_string(index); this->string = false; } Index(float index){ this->index = std::to_string(index); this->string = false; } }; static LuaManager* getSingleton(); inline lua_State* getState(){return state;} void buildScript(std::vector); int getInt(std::string); float getFloat(std::string); int getIntFromTable(std::string, std::vector); bool getBoolFromTable(std::string, std::vector); float getFloatFromTable(std::string, std::vector); std::string getStringFromTable(std::string, std::vector); std::string getString(std::string); private: LuaManager(); void prepareTableForRetrieval(std::string, std::vector&); lua_State *state = nullptr; }; typedef LuaManager::Index Index; } #endif