Add ScriptInterfaceFlow and ScriptInterfaceState. Add references.

This commit is contained in:
hispidence 2022-01-25 23:50:12 +00:00
parent b59b7e4a1c
commit 4429bd8aa2
6 changed files with 82 additions and 3 deletions

View file

@ -0,0 +1,27 @@
#include "frameworkandsol.h"
#include "ScriptInterfaceState.h"
#include "GameLogicScript.h"
#include "GameFlowScript.h"
sol::state g_solState;
int lua_exception_handler(lua_State* L, sol::optional<std::exception const &> maybe_exception, sol::string_view description)
{
return luaL_error(L, description.data());
}
ScriptInterfaceGame* ScriptInterfaceState::CreateGame()
{
return new GameScript(&g_solState);
}
ScriptInterfaceFlow* ScriptInterfaceState::CreateFlow()
{
return new GameFlow(&g_solState);
}
void ScriptInterfaceState::Init()
{
g_solState.open_libraries(sol::lib::base, sol::lib::math);
g_solState.set_exception_handler(lua_exception_handler);
}