Пример #1
0
        /// <summary>
        /// Draws a card from the players hand
        /// If necessary, will shuffle the win pile and add to the end of the hand object
        /// </summary>
        /// <returns>Next card to be played</returns>
        public Card DrawHand()
        {
            if (_hand.NumberOfCards == 0 && _winPile.NumberOfCards == 0)    //  Player out of cards
            {
                return(null);
            }

            if (_hand.NumberOfCards == 0)           //  Player needs to move won reserves to hand
            {
                //Console.WriteLine("Player reshuffling hand");
                _winPile.Shuffle();
                _hand.AddCards(_winPile.RemoveAll());
            }

            return(_hand.RemoveNextCard());
        }
Пример #2
0
 /// <summary>
 /// Adds a list of cards to the player's winning's pile
 /// </summary>
 /// <param name="cards">List of cards</param>
 public void AddToWinPile(List <Card> cards)
 {
     _winPile.AddCards(cards);
 }