Exemplo n.º 1
0
        // Divide the deck between all players
        private static List <Player> DivideDeck(Deck deck, List <Player> allPlayers)
        {
            // Split provided deck into two
            Deck[] playerDecks = Deck.DivideDeck(deck, allPlayers.Count);

            // Assign each deck to each player
            foreach (Player player in allPlayers)
            {
                player.drawDeck  = playerDecks[allPlayers.IndexOf(player)];
                player.scoreDeck = new Deck();
                Console.WriteLine("Cards in {0} deck {1}", player.GetName(), player.drawDeck.GetCount());
            }

            return(allPlayers);
        }