예제 #1
0
 //------------------------------------------------------
 public bool MoveCardTo(CardType card, BaseDeck <CardType> other)
 {
     if (Contains(card))
     {
         other.AddCard(card);
         m_cards.Remove(card);
         return(true);
     }
     return(false);
 }
예제 #2
0
        //------------------------------------------------------
        public int MoveCardsTo(int requested, BaseDeck <CardType> other)
        {
            int oldSize = Size;

            if (requested >= oldSize)
            {
                other.AddCards(m_cards);
                m_cards.Clear();
                return(oldSize);
            }
            else
            {
                int             index  = oldSize - requested;
                List <CardType> drawed = m_cards.GetRange(index, requested);
                other.AddCards(drawed);
                m_cards.RemoveRange(index, requested);
                return(requested);
            }
        }
예제 #3
0
 public void CopyFrom(BaseDeck <CardType> other)
 {
     m_owner = other.Owner;
     AddCards(other.Cards);
 }
예제 #4
0
 //------------------------------------------------------
 public void MoveAllCardsTo(BaseDeck <CardType> other)
 {
     MoveCardsTo(Size, other);
 }