Esempio n. 1
0
        public void RemoveCondition(float timer)
        {
            if (IsEmpty())
            {
                return;
            }


            LinkNode <CheckBackMsg> pNext = this.Head;

            //  LinkNode<T> node  =new LinkNode<T>(obj);



            // 首先释放头部以后
            while (pNext.Next != null)
            {
                LinkNode <CheckBackMsg> tmpNode = pNext.Next;

                if (tmpNode.Data.ReduceTime(timer))
                {
                    sendBackMsg.ChangeEventId(tmpNode.Data.msgId);
                    MsgCenter.instance.SendToMsg(sendBackMsg);
                    pNext.Next = tmpNode.Next;
                    tmpNode.Dispose();
                }
                else
                {
                    pNext = pNext.Next;
                }
            }

            // 判断头部是否
            if (this.Head.Data.ReduceTime(timer))
            {
                LinkNode <CheckBackMsg> tmpNode = this.Head;

                sendBackMsg.ChangeEventId(tmpNode.Data.msgId);
                MsgCenter.instance.SendToMsg(sendBackMsg);

                this.Head = this.Head.Next;
                tmpNode.Dispose();
            }
        }
Esempio n. 2
0
 static int ChangeEventId(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 2);
         U3DEventFrame.MsgBase obj = (U3DEventFrame.MsgBase)ToLua.CheckObject(L, 1, typeof(U3DEventFrame.MsgBase));
         ushort arg0 = (ushort)LuaDLL.luaL_checknumber(L, 2);
         obj.ChangeEventId(arg0);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }