Example #1
0
 public bool consGetChunk(out byte[] _buff, out int len)
 {
     _buff = this.buff;
     len   = this.buffUsedLength;
     state = eBuffState.lockedConsumer;
     return(len > 0);
 }
Example #2
0
        public void UpdateVO_BuffState(eBuffState type, bool bAdd)
        {
            if (m_vCreature == null)
            {
                return;
            }
            CmdFspState fspState = new CmdFspState();

            fspState.type = (eVObjectState)type;
            fspState.bAdd = bAdd;
            m_vCreature.PushCommand(fspState);
        }
Example #3
0
 /// <summary>
 /// 通过状态BUFF的类型获取当前BUFF对象
 /// </summary>
 public BuffBase GetStateBuff(eBuffState type)
 {
     for (int i = 0; i < m_buffList.Count; i++)
     {
         BuffBase buff = m_buffList[i];
         if (buff.IsStateBuff() && buff.GetVal1() == (int)type)
         {
             return(buff);
         }
     }
     return(null);
 }
Example #4
0
        /// <summary>
        /// 设置状态,支持多状态
        /// </summary>
        public void SetState(eBuffState type, bool bSet)
        {
            int iType = (int)type;

            if (bSet)
            {
                m_buffState = m_buffState | (1 << iType);   // 一个为1都为1
            }
            else
            {
                m_buffState = m_buffState & ~(1 << iType);  // 两个都为1才是1
            }

            UpdateVO_BuffState(type, bSet);
        }
Example #5
0
 /// <summary>
 /// 包含状态类BUFF
 /// </summary>
 public bool bStateBuff(eBuffState type)
 {
     if (m_buffList == null)
     {
         return(false);
     }
     for (int i = 0; i < m_buffList.Count; i++)
     {
         BuffBase buff = m_buffList[i];
         if (buff.IsStateBuff() && buff.GetVal1() == (int)type)
         {
             return(true);
         }
     }
     return(false);
 }
Example #6
0
 public void consFreeChunk()
 {
     buffUsedLength = 0;
     state          = eBuffState.consumed;
 }
Example #7
0
 public void prodSubmitChunk(int nBufferUsed)
 {
     buffUsedLength = nBufferUsed;
     state          = eBuffState.produced;
 }
Example #8
0
 public byte[] prodGetBuffer()
 {
     state = eBuffState.lockedProducer;
     return(buff);
 }
Example #9
0
        public bool CheckState(eBuffState type)
        {
            int iType = (int)type;

            return(((m_buffState >> iType) & 1) > 0);
        }