Beispiel #1
0
 public void AddMultipleCards(Pile p)
 {
     // while there are still cards in the passed in pile, add them to main pile
     while (p.GetSize() > 0)
     {
         AddCard(p.GetNextCard());
     }
 }
Beispiel #2
0
        public Card PlayNextCard()
        {
            // if the player has run out of cards in their current deck, replace their pile with the pile of won cards
            if (currentPile.GetSize() == 0)
            {
                ReplaceCurrentPile();
            }

            // if the player has not run out of cards, return the next card in the current pile
            if (currentPile.GetSize() > 0)
            {
                return(currentPile.GetNextCard());
            }

            return(null);
        }