From e92caa97329016d012b46b9d37e1b2c3b613a8f2 Mon Sep 17 00:00:00 2001 From: chai Date: Sat, 10 Nov 2018 20:13:55 +0800 Subject: =?UTF-8?q?*=E4=BF=AE=E6=94=B9=E4=BB=A3=E7=A0=81=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lua/modules/time/je_lua_timer.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 src/lua/modules/time/je_lua_timer.cpp (limited to 'src/lua/modules/time/je_lua_timer.cpp') 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& TimerRef; + + LUA_IMPLEMENT inline TimerRef checkTimer(lua_State* L) + { + Proxy* proxy = (Proxy*)luax_checktype(L, 1, JIN_TIME_TIMER); + return proxy->getShared(); + } + + 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 -- cgit v1.1-26-g67d0