1 #ifndef LUAUDATAPARAM_H
2 #define LUAUDATAPARAM_H
9 #include "luacvector2f.h"
10 #include "luacrectf.h"
11 #include "luacphysics.h"
12 #include "luacentity.h"
13 #include "luacdebug.h"
14 #include "luaccolor.h"
15 #include "luactimer.h"
16 #include "luacinput.h"
17 #include "luacstate.h"
18 #include "luaccamera.h"
20 #include "luacimage.h"
21 #include "luacwindow.h"
22 #include "luacanimatedimage.h"
47 void Push(lua_State *l)
override {
55 void Push(lua_State *l, std::string name)
override {
57 lua_setglobal(l, name.c_str());
65 return mRetriever(l, -1);
70 const static std::function<void(lua_State*, const T*)> mPusher;
71 const static std::function<T*(lua_State*, int)> mRetriever;
86 typedef LuaUdataParam<std::shared_ptr<AnimatedImage>> AnimImgParam;
88 const std::function<void(lua_State*, const std::shared_ptr<AnimatedImage>*)>
91 const std::function<std::shared_ptr<AnimatedImage>*(lua_State*, int)>
95 typedef LuaUdataParam<std::weak_ptr<Camera>> CameraParam;
97 const std::function<void(lua_State*, const std::weak_ptr<Camera>*)>
100 const std::function<std::weak_ptr<Camera>*(lua_State*, int)>
104 typedef LuaUdataParam<Color> ColorParam;
106 const std::function<void(lua_State*, const Color*)>
109 const std::function<Color*(lua_State*, int)>
113 typedef LuaUdataParam<std::shared_ptr<Entity>> EntityParam;
115 const std::function<void(lua_State*, const std::shared_ptr<Entity>*)>
118 const std::function<std::shared_ptr<Entity>*(lua_State*, int)>
122 typedef LuaUdataParam<std::shared_ptr<Image>> ImageParam;
124 const std::function<void(lua_State*, const std::shared_ptr<Image>*)>
127 const std::function<std::shared_ptr<Image>*(lua_State*, int)>
131 typedef LuaUdataParam<std::weak_ptr<Physics>> PhysicsParam;
133 const std::function<void(lua_State*, const std::weak_ptr<Physics>*)>
136 const std::function<std::weak_ptr<Physics>*(lua_State*, int)>
140 typedef LuaUdataParam<Rectf> RectfParam;
142 const std::function<void(lua_State*, const Rectf*)>
145 const std::function<Rectf*(lua_State*, int)>
149 typedef LuaUdataParam<std::shared_ptr<Text>> TextParam;
151 const std::function<void(lua_State*, const std::shared_ptr<Text>*)>
154 const std::function<std::shared_ptr<Text>*(lua_State*, int)>
158 typedef LuaUdataParam<Timer> TimerParam;
160 const std::function<void(lua_State*, const Timer*)>
163 const std::function<Timer*(lua_State*, int)>
167 typedef LuaUdataParam<Vector2f> Vector2fParam;
169 const std::function<void(lua_State*, const Vector2f*)>
172 const std::function<Vector2f*(lua_State*, int)>