LPCGame
A Simple 2d Game Engine
 All Classes Namespaces Functions Variables Enumerations Enumerator Pages
luacentity.h
1 #ifndef LUACENTITY_H
2 #define LUACENTITY_H
3 
4 #include <string>
5 #include <memory>
6 #include <lua.hpp>
7 #include "luacudata.h"
8 #include "core/entity.h"
9 
11 
15 namespace LuaC {
17  const std::string entityMeta = "LPC.Entity";
19  const std::string entityClass = "Entity";
21  template<>
22  const std::string UdataLib<std::shared_ptr<Entity>>::mMetaTable = entityMeta;
27  class EntityLib : public UdataLib<std::shared_ptr<Entity>> {
28  public:
30  static int luaopen_entity(lua_State *l);
31 
32  private:
34  static const struct luaL_reg luaEntityLib[];
36  static int newEntity(lua_State *l);
38  static int callFunction(lua_State *caller);
39  //Destroy the Entity, removing it from the manager and existence
40  static int destroy(lua_State *l);
41  //Release the Entity shared ptr
42  static int release(lua_State *l);
44  static int getPhysics(lua_State *l);
45  static int getBox(lua_State *l);
46  static int getTag(lua_State *l);
47  static int getName(lua_State *l);
48  //Toggle rendering
49  static int render(lua_State *l);
51  static int newIndex(lua_State *l);
54  static int setTag(lua_State *l, int i);
56  static int toString(lua_State *l);
57  static int concat(lua_State *l);
59  static int garbageCollection(lua_State *l);
60  };
61 }
62 
63 #endif