aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/time/je_lua_timer.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2018-11-10 20:13:55 +0800
committerchai <chaifix@163.com>2018-11-10 20:13:55 +0800
commite92caa97329016d012b46b9d37e1b2c3b613a8f2 (patch)
tree5bef0b7547e12f61dede5e09843e1718b808f9c4 /src/lua/modules/time/je_lua_timer.cpp
parent63153bc8e742c522cfd3f5ab10609966e33310e6 (diff)
*修改代码结构
Diffstat (limited to 'src/lua/modules/time/je_lua_timer.cpp')
-rw-r--r--src/lua/modules/time/je_lua_timer.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/lua/modules/time/je_lua_timer.cpp b/src/lua/modules/time/je_lua_timer.cpp
new file mode 100644
index 0000000..c28aafe
--- /dev/null
+++ b/src/lua/modules/time/je_lua_timer.cpp
@@ -0,0 +1,30 @@
+#include "../types.h"
+#include "lua/common/je_lua_common.h"
+#include "je_lua_timer.h"
+
+namespace JinEngine
+{
+ namespace Lua
+ {
+
+ typedef Shared<Timer>& TimerRef;
+
+ LUA_IMPLEMENT inline TimerRef checkTimer(lua_State* L)
+ {
+ Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_TIME_TIMER);
+ return proxy->getShared<Timer>();
+ }
+
+ LUA_IMPLEMENT int l_every(lua_State* L)
+ {
+ //TimerRef ref = checkTimer(L);
+ //Timer* timer = ref.getObject();
+ //int n = luax_checkinteger(L, 1);
+ //int ref = luax_ref(L, 2);
+ //timer->every(n, [](void* data)->void {
+ //
+ //}, );
+ }
+
+ }
+} \ No newline at end of file