Exemplo n.º 1
0
    static int TriggerListener(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 4 && LuaScriptMgr.CheckTypes(L, 1, typeof(IOLuaHelper), typeof(int), typeof(int), typeof(bool)))
        {
            IOLuaHelper obj  = (IOLuaHelper)LuaScriptMgr.GetNetObjectSelf(L, 1, "IOLuaHelper");
            int         arg0 = (int)LuaDLL.lua_tonumber(L, 2);
            int         arg1 = (int)LuaDLL.lua_tonumber(L, 3);
            bool        arg2 = LuaDLL.lua_toboolean(L, 4);
            obj.TriggerListener(arg0, arg1, arg2);
            return(0);
        }
        else if (count == 4 && LuaScriptMgr.CheckTypes(L, 1, typeof(IOLuaHelper), typeof(EnumIOEvent), typeof(int), typeof(bool)))
        {
            IOLuaHelper obj  = (IOLuaHelper)LuaScriptMgr.GetNetObjectSelf(L, 1, "IOLuaHelper");
            EnumIOEvent arg0 = (EnumIOEvent)LuaScriptMgr.GetLuaObject(L, 2);
            int         arg1 = (int)LuaDLL.lua_tonumber(L, 3);
            bool        arg2 = LuaDLL.lua_toboolean(L, 4);
            obj.TriggerListener(arg0, arg1, arg2);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: IOLuaHelper.TriggerListener");
        }

        return(0);
    }
Exemplo n.º 2
0
    static int RemoveListener(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 3 && LuaScriptMgr.CheckTypes(L, 1, typeof(IOLuaHelper), typeof(int), typeof(string)))
        {
            IOLuaHelper obj  = (IOLuaHelper)LuaScriptMgr.GetNetObjectSelf(L, 1, "IOLuaHelper");
            int         arg0 = (int)LuaDLL.lua_tonumber(L, 2);
            string      arg1 = LuaScriptMgr.GetString(L, 3);
            obj.RemoveListener(arg0, arg1);
            return(0);
        }
        else if (count == 3 && LuaScriptMgr.CheckTypes(L, 1, typeof(IOLuaHelper), typeof(EnumIOEvent), typeof(string)))
        {
            IOLuaHelper obj  = (IOLuaHelper)LuaScriptMgr.GetNetObjectSelf(L, 1, "IOLuaHelper");
            EnumIOEvent arg0 = (EnumIOEvent)LuaScriptMgr.GetLuaObject(L, 2);
            string      arg1 = LuaScriptMgr.GetString(L, 3);
            obj.RemoveListener(arg0, arg1);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: IOLuaHelper.RemoveListener");
        }

        return(0);
    }
Exemplo n.º 3
0
    static int _CreateIOLuaHelper(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            IOLuaHelper obj = new IOLuaHelper();
            LuaScriptMgr.PushObject(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: IOLuaHelper.New");
        }

        return(0);
    }
Exemplo n.º 4
0
    static int RegesterListener(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 4 && LuaScriptMgr.CheckTypes(L, 1, typeof(IOLuaHelper), typeof(int), typeof(UtilCommon.OnIOEventHandle), typeof(string)))
        {
            IOLuaHelper obj  = (IOLuaHelper)LuaScriptMgr.GetNetObjectSelf(L, 1, "IOLuaHelper");
            int         arg0 = (int)LuaDLL.lua_tonumber(L, 2);
            UtilCommon.OnIOEventHandle arg1 = null;
            LuaTypes funcType3 = LuaDLL.lua_type(L, 3);

            if (funcType3 != LuaTypes.LUA_TFUNCTION)
            {
                arg1 = (UtilCommon.OnIOEventHandle)LuaScriptMgr.GetLuaObject(L, 3);
            }
            else
            {
                LuaFunction func = LuaScriptMgr.GetLuaFunction(L, 3);
                arg1 = (param0, param1) =>
                {
                    int top = func.BeginPCall();
                    LuaScriptMgr.Push(L, param0);
                    LuaScriptMgr.Push(L, param1);
                    func.PCall(top, 2);
                    func.EndPCall(top);
                };
            }

            string arg2 = LuaScriptMgr.GetString(L, 4);
            obj.RegesterListener(arg0, arg1, arg2);
            return(0);
        }
        else if (count == 4 && LuaScriptMgr.CheckTypes(L, 1, typeof(IOLuaHelper), typeof(EnumIOEvent), typeof(UtilCommon.OnIOEventHandle), typeof(string)))
        {
            IOLuaHelper obj  = (IOLuaHelper)LuaScriptMgr.GetNetObjectSelf(L, 1, "IOLuaHelper");
            EnumIOEvent arg0 = (EnumIOEvent)LuaScriptMgr.GetLuaObject(L, 2);
            UtilCommon.OnIOEventHandle arg1 = null;
            LuaTypes funcType3 = LuaDLL.lua_type(L, 3);

            if (funcType3 != LuaTypes.LUA_TFUNCTION)
            {
                arg1 = (UtilCommon.OnIOEventHandle)LuaScriptMgr.GetLuaObject(L, 3);
            }
            else
            {
                LuaFunction func = LuaScriptMgr.GetLuaFunction(L, 3);
                arg1 = (param0, param1) =>
                {
                    int top = func.BeginPCall();
                    LuaScriptMgr.Push(L, param0);
                    LuaScriptMgr.Push(L, param1);
                    func.PCall(top, 2);
                    func.EndPCall(top);
                };
            }

            string arg2 = LuaScriptMgr.GetString(L, 4);
            obj.RegesterListener(arg0, arg1, arg2);
            return(0);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: IOLuaHelper.RegesterListener");
        }

        return(0);
    }