aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAndy Belle-Isle <drumsetmonkey@gmail.com>2019-08-27 00:24:05 -0400
committerAndy Belle-Isle <drumsetmonkey@gmail.com>2019-08-27 00:24:05 -0400
commit787393dd86d6c37b5680847dd4eef14406a86687 (patch)
tree942e0155c484d6f41bb8f8f25e67c53d30dbeb2e /src
parent6acad98c1dba2c07045ae724da1f833ee8369d47 (diff)
Created basic init script
Diffstat (limited to 'src')
-rw-r--r--src/main.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index 0597d48..b3d4744 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -139,15 +139,38 @@ void logicLoop(void)
}
}
+struct Position : entityx::Component<Position>
+{
+ Position(float _x, float _y): x(_x), y(_y) {}
+
+ float x,y;
+};
+
void LuaTest(void)
{
using namespace entityx;
using namespace entityx::lua;
+ //export_component<Position>("Position",
+ // wrap_ctor<Position, float, float>([](float x, float y) {
+ // return Position(x, y);
+ // }),
+ // [](MemberRegister<Position>& m) {
+ // m.add("x", &Position::x);
+ // m.add("y", &Position::y);
+ // }
+ //);
+
lua_State* L = luaL_newstate();
luaL_openlibs(L);
setup_entityx_api(L);
+ std::shared_ptr<EventManager> events(new EventManager());
+ std::shared_ptr<EntityManager> entities(new EntityManager(*events));
+ new_entity_manager(L, entities, "manager");
+
+ luaL_dofile(L, "Scripts/init.lua");
+
lua_close(L);
}