Exemplo n.º 1
0
 /// <summary>
 /// Instantiates a Game object.
 /// </summary>
 /// <param name="p1Name">A string representing the name of Player 1</param>
 /// <param name="p2Name">A string representing the name of Player 2</param>
 public Game(string p1Name, string p2Name)
 {
     Player1 = new Player(p1Name);
     Player2 = new Player(p2Name);
     DeckManager.CreateDecks(Player1, Player2);
     totalTurns = 0;
 }
Exemplo n.º 2
0
        /// <summary>
        /// Shuffles the deck of a player.
        /// </summary>
        /// <param name="player">The player who's deck is to be shuffled.</param>
        private void ShufflePlayerDeck(Player player)
        {
            List <Card> pDeck = player.Deck.ToList();

            DeckManager.Shuffle(pDeck);
            player.Deck = new Queue <Card>();
            player.AddCardsToDeck(pDeck);
        }