Exemple #1
0
        public static void playerTurn(Player currentPlayer, Player opponent, List <Card> activeDeck)
        {
            Console.WriteLine($"\nPlayer {currentPlayer.PlayerNumber} it is your turn! Here is your hand: \n");

            Player.displayHand(currentPlayer);        // Display current player hand

            Player.checkForDuplicates(currentPlayer); // Check hand for duplicate cards

            //Console.WriteLine($"\nplayer 2:  Here is your hand: \n");
            //Player.displayHand(opponent);

            // Validate user input
            CardValue tempValue = promptForInput(currentPlayer);

            // Ensure that the card request exists in the current player's hand
            CardValue value = checkPlayerHand(currentPlayer, tempValue);

            // Will check opponent's hand --> go fish or add a pair to current player pair number
            checkOpponentHand(currentPlayer, opponent, value, activeDeck);


            Console.WriteLine($"\nPlayer {currentPlayer.PlayerNumber}'s turn is complete. Hit enter to start player 2's turn");
            Console.ReadLine();
            Console.Clear();
        }