This commit is contained in:
aozhiwei 2021-04-14 17:24:12 +08:00
parent cab4757965
commit 8b6410826d
2 changed files with 15 additions and 1 deletions

View File

@ -29,6 +29,16 @@ namespace a8
}
}
void LuaEngine::Init(const std::string& lua_path)
{
lua_path_ = lua_path;
}
void LuaEngine::UnInit()
{
}
bool LuaEngine::LoadModule(const std::string& module_name)
{
std::string real_filename = lua_path_ + module_name;

View File

@ -11,6 +11,11 @@ namespace a8
LuaEngine();
~LuaEngine();
void Init(const std::string& lua_path);
void UnInit();
std::string GetErrorMsg() { return last_error_msg_; };
lua_State* GetLuaState() { return lua_state_; };
bool LoadModule(const std::string& module_name);
bool LoadString(const std::string& str);
std::tuple<bool, a8::XValue> CallGlobalFunc(const char* func_name,
@ -18,7 +23,6 @@ namespace a8
std::tuple<bool, a8::XValue> CallModuleFunc(const char* module_name,
const char* func_name,
std::initializer_list<a8::XValue> args);
std::string GetErrorMsg() { return last_error_msg_; };
private: