diff options
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 84 |
1 files changed, 0 insertions, 84 deletions
diff --git a/src/main.cpp b/src/main.cpp index 386aafc..3dc7bed 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,7 +20,6 @@ #include <lua.hpp> #include <entityx/entityx.h> -#include <LuaBridge/LuaBridge.h> #include "engine.hpp" @@ -50,86 +49,3 @@ int main([[maybe_unused]] int argc, [[maybe_unused]] char *argv[]) return 0; } - -/* -using namespace entityx; -namespace lb = luabridge; - -EventManager events; -EntityManager entities(events); - -lua_State* L; - -//lb::LuaRef spawn(lb::LuaRef ref) -//{ -// lb::LuaRef entity(L); -// entity = lb::newTable(L); -// -// if (ref.isTable()) { -// -// Entity e = entities.create(); -// -// for (auto &&comp : lb::pairs(ref)) { -// if (comp.first.cast<std::string>() == "Position") { -// entity["Position"] = -// e.assign<Position>(Position().FromLua(comp.second)).get(); -// } else if (comp.first.cast<std::string>() == "init") { -// entity["init"] = comp.second; -// } -// } -// } else { -// std::cerr << "Parameter to spawn() must be a table!" << std::endl; -// } -// -// return entity; -//} -// - -ScriptSystem sc; - -lb::LuaRef spawn(lb::LuaRef ref) -{ - return sc.spawn(ref); -} - - -void LuaTest(void) -{ - - sc.configure(entities, events); - - // Functions export - lb::getGlobalNamespace(sc.getState()) - .beginNamespace("game") - .addFunction("spawn", spawn) - .endNamespace(); - - sc.doFile(); - - - //L = luaL_newstate(); - //luaL_openlibs(L); - - //lb::getGlobalNamespace(L). - // beginNamespace("comp") - // .beginClass<Position>("Position") - // .addConstructor<void(*)(float, float)>() - // .addProperty("x", &Position::x) - // .addProperty("y", &Position::y) - // .endClass() - // .endNamespace(); - - //lb::getGlobalNamespace(L) - // .beginNamespace("game") - // .addFunction("spawn", spawn) - // .endNamespace(); - - //if (luaL_dofile(L, "Scripts/init.lua")) { - // std::cout << "Lua error: " << lua_tostring(L, -1) << std::endl; - //} - - //entities.each<Position>([&](Entity, Position& p){std::cout << p.x << "," << p.y << std::endl;}); - - //lua_close(L); -} -*/ |