예제 #1
0
파일: Program.cs 프로젝트: gjamesbaker/BJB
        private static void PerformOneGame(IBlackjackTable table)
        {
            var game = new Game(table);

            System.Console.WriteLine();
            System.Console.WriteLine("***************************");
            System.Console.WriteLine("******   NEW ROUND   ******");
            System.Console.WriteLine("***************************");
            System.Console.WriteLine();

            game.StartNewGame();
            game.CallForBets();
            game.DealHands();

            System.Console.WriteLine("***   Initial Deal   ***");
            System.Console.WriteLine();
            System.Console.WriteLine(game.ToString());

            game.OfferSplits();

            System.Console.WriteLine("***   After OfferSplits   ***");
            System.Console.WriteLine();
            System.Console.WriteLine(game.ToString());

            game.OfferDoubleDowns();

            System.Console.WriteLine("***   After OfferDoubleDowns   ***");
            System.Console.WriteLine();
            System.Console.WriteLine(game.ToString());

            game.FillPlayerHands();

            System.Console.WriteLine("***   After FillPlayerHands   ***");
            System.Console.WriteLine();
            System.Console.WriteLine(game.ToString());

            game.FillDealerHand();

            System.Console.WriteLine("***   After FillDealerHands   ***");
            System.Console.WriteLine();
            System.Console.WriteLine(game.ToString());

            var amount = game.SettleBets();
            var winnings = string.Format("House Winnings: {0:C}", amount);

            System.Console.WriteLine("***   After SettleBets   ***");
            System.Console.WriteLine();
            System.Console.WriteLine(game.ToString());
            System.Console.WriteLine(winnings);

            System.Console.ReadLine();
        }