Beispiel #1
0
        public void NewMatch()
        {
            if (_player.GetCurrentMagicPotions() > 0)
            {
                Console.WriteLine($"Do you wanna drink your Magic Potion? Instock: {_player.GetCurrentMagicPotions()} --- Y/N");
                string drinkMP = string.Empty;

                while (string.IsNullOrWhiteSpace(drinkMP))
                {
                    drinkMP = Console.ReadLine().ToUpper();

                    if (drinkMP == "Y")
                    {
                        _player.UsePotion();
                    }
                    else if (drinkMP == "N")
                    {
                        Console.WriteLine($"YOU FOOL!!! YOU CANNOT BEAT ME WITHOUT HELP!!! MUAHAHAHAHA");
                    }
                    else
                    {//invalid choice
                        drinkMP = string.Empty;
                    }
                }
            }

            Options playerTurn = _player.GetChoice();
            Options botTurn    = _bot.GetChoice();
            Winner  winner     = GetWinner(playerTurn, botTurn);

            // tabulate result

            Console.WriteLine($"Your Choice : {playerTurn}");
            Console.WriteLine($"My Choice : {botTurn}");
            EndMatch(winner);
        }