8 #include "external/json/json.h"
10 #include "luac/luacparam.h"
38 std::string
File()
const;
46 template<
class ReturnType>
48 std::vector<LuaC::LuaParam*> args = std::vector<LuaC::LuaParam*>()) -> decltype(ReturnType::Retrieve(mL))
51 lua_getglobal(mL,
function.c_str());
57 if (lua_pcall(mL, args.size(), 1, 0) != 0)
58 Debug::Log(
"Error calling: " +
function +
" in script: " + mFile +
" " + lua_tostring(mL, -1));
60 return ReturnType::Retrieve(mL);
63 void CallFunction(std::string
function, std::vector<LuaC::LuaParam*> args = std::vector<LuaC::LuaParam*>()){
65 lua_getglobal(mL,
function.c_str());
71 if (lua_pcall(mL, args.size(), 0, 0) != 0)
72 Debug::Log(
"Error calling: " +
function +
" in script: " + mFile +
" " + lua_tostring(mL, -1));
80 void AddLoader(
int (*loader)(lua_State*));