Exemplo n.º 1
0
 static int set_zero(IntPtr L)
 {
     try
     {
         TimeHelper.ClockTime arg0 = (TimeHelper.ClockTime)ToLua.CheckObject(L, 2, typeof(TimeHelper.ClockTime));
         TimeHelper.ClockTime.zero = arg0;
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 2
0
 static int ToString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         TimeHelper.ClockTime obj = (TimeHelper.ClockTime)ToLua.CheckObject(L, 1, typeof(TimeHelper.ClockTime));
         string o = obj.ToString();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 3
0
 static int Parse(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         string arg0            = ToLua.CheckString(L, 1);
         TimeHelper.ClockTime o = TimeHelper.ClockTime.Parse(arg0);
         ToLua.PushValue(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int ClockTimeToSecond(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         TimeHelper.ClockTime arg0 = (TimeHelper.ClockTime)ToLua.CheckObject(L, 1, typeof(TimeHelper.ClockTime));
         int o = TimeHelper.ClockTimeToSecond(arg0);
         LuaDLL.lua_pushinteger(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
 static int SecondToClockTime(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
         TimeHelper.ClockTime o = TimeHelper.SecondToClockTime(arg0);
         ToLua.PushValue(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 6
0
 static int ToSeconds(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         TimeHelper.ClockTime obj = (TimeHelper.ClockTime)ToLua.CheckObject(L, 1, typeof(TimeHelper.ClockTime));
         int o = obj.ToSeconds();
         LuaDLL.lua_pushinteger(L, o);
         ToLua.SetBack(L, 1, obj);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemplo n.º 7
0
    static int get_second(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            TimeHelper.ClockTime obj = (TimeHelper.ClockTime)o;
            int ret = obj.second;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index second on a nil value" : e.Message));
        }
    }
Exemplo n.º 8
0
    static int set_second(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            TimeHelper.ClockTime obj = (TimeHelper.ClockTime)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.second = arg0;
            ToLua.SetBack(L, 1, obj);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index second on a nil value" : e.Message));
        }
    }
Exemplo n.º 9
0
    static int _CreateTimeHelper_ClockTime(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
                TimeHelper.ClockTime obj = new TimeHelper.ClockTime(arg0);
                ToLua.PushValue(L, obj);
                return(1);
            }
            else if (count == 3 && TypeChecker.CheckTypes(L, 1, typeof(int), typeof(int), typeof(int)))
            {
                int arg0 = (int)LuaDLL.luaL_checknumber(L, 1);
                int arg1 = (int)LuaDLL.luaL_checknumber(L, 2);
                int arg2 = (int)LuaDLL.luaL_checknumber(L, 3);
                TimeHelper.ClockTime obj = new TimeHelper.ClockTime(arg0, arg1, arg2);
                ToLua.PushValue(L, obj);
                return(1);
            }
            else if (count == 0)
            {
                TimeHelper.ClockTime obj = new TimeHelper.ClockTime();
                ToLua.PushValue(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: TimeHelper.ClockTime.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }