public bool consGetChunk(out byte[] _buff, out int len) { _buff = this.buff; len = this.buffUsedLength; state = eBuffState.lockedConsumer; return(len > 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); }
/// <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); }
/// <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); }
/// <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); }
public void consFreeChunk() { buffUsedLength = 0; state = eBuffState.consumed; }
public void prodSubmitChunk(int nBufferUsed) { buffUsedLength = nBufferUsed; state = eBuffState.produced; }
public byte[] prodGetBuffer() { state = eBuffState.lockedProducer; return(buff); }
public bool CheckState(eBuffState type) { int iType = (int)type; return(((m_buffState >> iType) & 1) > 0); }