Esempio n. 1
0
    /// <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;
    }
Esempio n. 2
0
    /// <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);
    }
Esempio n. 3
0
 /// <summary>
 /// Cleanly set a new token, discarding the old one.
 /// </summary>
 public void SetQueueToken(CQueueToken Token)
 {
     ReturnQueueToken();
     mQueueToken = Token;
 }
Esempio n. 4
0
 /// <summary>
 /// Give up token.
 /// </summary>
 public void DequeueQueueToken(CQueueToken Token)
 {
     Token.mExpired = true;
     mQueueList.Remove(Token);
     UpdateQueueTokens();
 }