Esempio n. 1
0
 //------------------------------------------------------
 public bool MoveCardTo(CardType card, BaseDeck <CardType> other)
 {
     if (Contains(card))
     {
         other.AddCard(card);
         m_cards.Remove(card);
         return(true);
     }
     return(false);
 }
Esempio n. 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);
            }
        }
Esempio n. 3
0
 public void CopyFrom(BaseDeck <CardType> other)
 {
     m_owner = other.Owner;
     AddCards(other.Cards);
 }
Esempio n. 4
0
 //------------------------------------------------------
 public void MoveAllCardsTo(BaseDeck <CardType> other)
 {
     MoveCardsTo(Size, other);
 }