mirror of
https://github.com/zoriya/Bomberman.git
synced 2026-05-17 12:54:59 +00:00
34 lines
451 B
C++
34 lines
451 B
C++
//
|
|
// Created by Louis Auzuret on 10/06/21
|
|
//
|
|
|
|
#include "LuaGate.hpp"
|
|
|
|
namespace LuaG
|
|
{
|
|
State::State()
|
|
: _state(luaL_newstate())
|
|
{
|
|
luaL_openlibs(_state);
|
|
}
|
|
|
|
State::~State()
|
|
{
|
|
lua_close(_state);
|
|
}
|
|
|
|
LuaState *State::getState(void)
|
|
{
|
|
return _state;
|
|
}
|
|
|
|
void State::dofile(std::string filepath)
|
|
{
|
|
luaL_dofile(_state, filepath.c_str());
|
|
}
|
|
|
|
void State::dostring(std::string str)
|
|
{
|
|
luaL_dostring(_state, str.c_str());
|
|
}
|
|
} |