コード例 #1
0
ファイル: PlayGame.cs プロジェクト: jages/CommandBlackJack
        static void ResolveGame(Table table)
        {
            Console.WriteLine("No Hits taken. Resolving the Game.");

            while (!table.GameOver())
            {
                table.Play(new TableCommand()
                {
                    action = TableCommand.Action.Hit, player = table.dealer
                });
            }
        }
コード例 #2
0
ファイル: PlayGame.cs プロジェクト: jages/CommandBlackJack
        static void Main(string[] args)
        {
            Console.OutputEncoding = Encoding.UTF8;

            Table table           = new Table();
            int   NumberofPlayers = GetPlayerCount();

            Player[] players = InitPlayers(NumberofPlayers);
            AddPlayers(players, table);
            table.Play(new TableCommand()
            {
                action = TableCommand.Action.ShuffleDeck
            });
            Console.Out.WriteLine(table.ToString());
            FristRound(table, players);
            Console.Out.WriteLine(table.ToString());
            while (!table.GameOver())
            {
                PlayRound(table, players);
                Console.Out.WriteLine(table.ToString());
            }
            Console.WriteLine("The Game is over.");
        }