/// <summary> /// Cleanly destroy the queue token we may posses. /// </summary> public void ReturnQueueToken() { if (mQueueToken != null) { CItemProxy proxy = mWorld.GetItemPorxy(mOwner, mQueueToken.mItemProxyID); if (proxy != null) { proxy.DequeueQueueToken(mQueueToken); } } mQueueToken = null; }
/// <summary> /// Get a queue token. /// </summary> public CQueueToken GetQueueToken() { CQueueToken token = new CQueueToken(); token.mExpired = false; token.mItemProxyID = mID; token.mQueueIndex = mQueueList.Count; token.mUsageSlot = -1; mQueueList.Add(token); // If we can see our item, then directly check if we can assign to it. // First get close before assigning? // We only want to assign when standing on the entry point? // Units could hold the token in their main unit, then we could call the unit // we we expire and get them to give up their token. UpdateQueueTokens(); return(token); }
/// <summary> /// Cleanly set a new token, discarding the old one. /// </summary> public void SetQueueToken(CQueueToken Token) { ReturnQueueToken(); mQueueToken = Token; }
/// <summary> /// Give up token. /// </summary> public void DequeueQueueToken(CQueueToken Token) { Token.mExpired = true; mQueueList.Remove(Token); UpdateQueueTokens(); }