Ejemplo n.º 1
0
    static int StopTimer(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1 && TypeChecker.CheckTypes(L, 1, typeof(MTimerManager)))
            {
                MTimerManager obj = (MTimerManager)ToLua.ToObject(L, 1);
                obj.StopTimer();
                return(0);
            }
            else if (count == 2 && TypeChecker.CheckTypes(L, 1, typeof(MTimerManager), typeof(int)))
            {
                MTimerManager obj  = (MTimerManager)ToLua.ToObject(L, 1);
                int           arg0 = (int)LuaDLL.lua_tonumber(L, 2);
                bool          o    = obj.StopTimer(arg0);
                LuaDLL.lua_pushboolean(L, o);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: MTimerManager.StopTimer"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Ejemplo n.º 2
0
 static int StartTimer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         MTimerManager obj  = (MTimerManager)ToLua.CheckObject(L, 1, typeof(MTimerManager));
         float         arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
         obj.StartTimer(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 3
0
 static int ResumeTimer(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         MTimerManager obj  = (MTimerManager)ToLua.CheckObject(L, 1, typeof(MTimerManager));
         int           arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         bool          o    = obj.ResumeTimer(arg0);
         LuaDLL.lua_pushboolean(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 4
0
    static int set_Interval(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            MTimerManager obj  = (MTimerManager)o;
            float         arg0 = (float)LuaDLL.luaL_checknumber(L, 2);
            obj.Interval = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Interval on a nil value" : e.Message));
        }
    }
Ejemplo n.º 5
0
    static int get_Interval(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            MTimerManager obj = (MTimerManager)o;
            float         ret = obj.Interval;
            LuaDLL.lua_pushnumber(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index Interval on a nil value" : e.Message));
        }
    }
Ejemplo n.º 6
0
    static int CreateTimer(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 6);
            MTimerManager obj       = (MTimerManager)ToLua.CheckObject(L, 1, typeof(MTimerManager));
            int           arg0      = (int)LuaDLL.luaL_checknumber(L, 2);
            int           arg1      = (int)LuaDLL.luaL_checknumber(L, 3);
            int           arg2      = (int)LuaDLL.luaL_checknumber(L, 4);
            TimerCallBack arg3      = null;
            LuaTypes      funcType5 = LuaDLL.lua_type(L, 5);

            if (funcType5 != LuaTypes.LUA_TFUNCTION)
            {
                arg3 = (TimerCallBack)ToLua.CheckObject(L, 5, typeof(TimerCallBack));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 5);
                arg3 = DelegateFactory.CreateDelegate(typeof(TimerCallBack), func) as TimerCallBack;
            }

            TimerOverCall arg4      = null;
            LuaTypes      funcType6 = LuaDLL.lua_type(L, 6);

            if (funcType6 != LuaTypes.LUA_TFUNCTION)
            {
                arg4 = (TimerOverCall)ToLua.CheckObject(L, 6, typeof(TimerOverCall));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 6);
                arg4 = DelegateFactory.CreateDelegate(typeof(TimerOverCall), func) as TimerOverCall;
            }

            bool o = obj.CreateTimer(arg0, arg1, arg2, arg3, arg4);
            LuaDLL.lua_pushboolean(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }