Пример #1
0
        public void PlayerTurn(Deck deck1, Game game)
        {
            System.Console.WriteLine($"{this.name}'s Turn");
            System.Console.WriteLine($"{this.name} has {this.DisplayPoints()} points.");
            if (this.CheckBlackjack() == true)
            {
                System.Console.WriteLine("Blackjack!");
            }
            while (this.DisplayPoints() < 21)
            {
                System.Console.WriteLine("Please select an option 1: draw or 2: stay");
                string selection = Console.ReadLine();

                if (selection == "1")
                {
                    this.PlayerDraw(deck1);
                    System.Console.WriteLine($"{this.name} now has {this.DisplayPoints()} points.");
                }
                else if (selection == "2")
                {
                    System.Console.WriteLine($"{this.name}'s turn has ended.");
                    break;
                }
            }
            if (this.DisplayPoints() > 21)
            {
                System.Console.WriteLine($"{this.name} Lost.");
            }
            else
            {
                Console.ForegroundColor = ConsoleColor.Gray;
                game.DealerTurn(deck1);
            }
        }