示例#1
0
        private void RunTurn()
        {
            turnActive = true;
            string[] menuSelection = { "Hit", "Pass" };
            do
            {
                Console.WriteLine($"{currentPlayer}'s Turn ");
                currentPlayer.Hand.ForEach(c => Console.Write($"{c}, "));
                Console.WriteLine();
                int choice = ConsoleIO.PromptForMenuSelection(menuSelection, false);
                switch (choice)
                {
                case 1:
                    c.HitPlayer(currentPlayer);
                    break;

                case 2:
                    turnActive = false;
                    break;

                default:
                    throw new ArgumentOutOfRangeException(nameof(choice), "You gotta select a value between one and two.");
                }

                Console.WriteLine($"{c.CountHand(currentPlayer.Hand)}");
            } while (turnActive);
        }
示例#2
0
        private void RunBusterMoves(BlackJackController blackJackController)
        {
            blackJackController.StartGame <CardPlayer>();
            var player = blackJackController.Players[0];

            blackJackController.TakeInitialBet(player, 100);

            for (int i = 0; i < 30; i++)
            {
                blackJackController.HitPlayer(player);
            }
        }