aboutsummaryrefslogtreecommitdiff
path: root/src/lua/modules/time/je_lua_timer.cpp
blob: c28aafe97664bbd3d394ce754d047dadd601e76d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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 {
            //
            //}, );
        }

    }
}