Exemple #1
0
        /// <summary>
        /// 移除一个在判定区的牌
        /// </summary>
        /// <param name="aCard">牌对象</param>
        /// <returns>移除成功返回true , 失败或者参数为null返回false</returns>
        public bool RemoveBuff(Card aCard)
        {
            if (aCard == null)
            {
                return(false);
            }
            Stack <Card> tmp = new Stack <Card>();
            bool         ret = false;

            while (Debuff.Count != 0)
            {
                if (aCard.Same(Debuff.Peek()))
                {
                    Debuff.Pop();
                    ret = true;
                }
                else
                {
                    tmp.Push(Debuff.Pop());
                }
            }
            while (tmp.Count != 0)
            {
                Debuff.Push(tmp.Pop());
            }
            return(ret);
        }
Exemple #2
0
 /// <summary>
 /// 移除一张手牌
 /// </summary>
 /// <param name="aCard">要移除的手牌对象</param>
 /// <returns>移除成功返回true, 失败或者参数为null返回false</returns>
 public bool RemoveHand(Card aCard)
 {
     if (aCard == null)
     {
         return(false);
     }
     foreach (Card c in Hands)
     {
         if (aCard.Same(c))
         {
             Hands.Remove(c);
             return(true);
         }
     }
     return(false);
 }