static int AddEveryDelegateToTimeCalc(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 4);
            TimeHelper obj  = (TimeHelper)ToLua.CheckObject(L, 1, typeof(TimeHelper));
            string     arg0 = ToLua.CheckString(L, 2);
            float      arg1 = (float)LuaDLL.luaL_checknumber(L, 3);
            DelegateHelper.IntDelegate arg2 = null;
            LuaTypes funcType4 = LuaDLL.lua_type(L, 4);

            if (funcType4 != LuaTypes.LUA_TFUNCTION)
            {
                arg2 = (DelegateHelper.IntDelegate)ToLua.CheckObject(L, 4, typeof(DelegateHelper.IntDelegate));
            }
            else
            {
                LuaFunction func = ToLua.ToLuaFunction(L, 4);
                arg2 = DelegateFactory.CreateDelegate(typeof(DelegateHelper.IntDelegate), func) as DelegateHelper.IntDelegate;
            }

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