MCPcopy Create free account
hub / github.com/ObEngine/ObEngine / initScript

Method initScript

src/Core/Engine/Engine.cpp:53–71  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51 }
52
53 void Engine::initScript()
54 {
55 m_lua = std::make_unique<sol::state>();
56 m_lua->open_libraries(sol::lib::base, sol::lib::string, sol::lib::table,
57 sol::lib::package, sol::lib::os, sol::lib::coroutine, sol::lib::math,
58 sol::lib::count, sol::lib::debug, sol::lib::io, sol::lib::bit32);
59
60 m_lua->safe_script("LuaCore = {}");
61 m_lua->safe_script_file("Lib/Internal/ScriptInit.lua"_fs);
62 m_lua->safe_script_file("Lib/Internal/Triggers.lua"_fs);
63
64 Bindings::IndexAllBindings(*m_lua);
65 m_lua->safe_script_file("Lib/Internal/Searcher.lua"_fs);
66 m_lua->safe_script_file("Lib/Internal/GameInit.lua"_fs);
67 m_lua->safe_script_file("Lib/Internal/Logger.lua"_fs);
68 m_lua->set_exception_handler(&lua_exception_handler);
69
70 (*m_lua)["Engine"] = this;
71 }
72
73 void Engine::initResources()
74 {

Callers 1

initMethod · 0.95

Calls 5

IndexAllBindingsFunction · 0.85
open_librariesMethod · 0.80
safe_scriptMethod · 0.80
safe_script_fileMethod · 0.80
set_exception_handlerMethod · 0.80

Tested by

no test coverage detected