Пример #1
0
        private static void PlayerChoice(IGame game)
        {
            Dictionary <PlayerChoisces, playerAction> operations = new Dictionary <PlayerChoisces, playerAction>
            {
                { PlayerChoisces.Hit, game.Hit },
                { PlayerChoisces.Stand, game.Stand }
            };

            operations[MyConsoleUI.AskPlayerChoice()].Invoke();
        }
Пример #2
0
        static void Do(IGame game)
        {
            bool isFinished = false;

            do
            {
                //PrintGameState(game);
                MyConsoleUI.PrintShuffleScore(game.PlayerPointsCount, game.DealerPointsCount);
                if (game.isShuffleActive)
                {
                    PlayerChoice(game);
                }
                else
                {
                    MyConsoleUI.PrintWins(GameState.PlayerWinsCount, GameState.DealerWinsCount);
                    MyConsoleUI.PrintStartShuffle();
                    game.NewGame();
                }
            } while (!isFinished);
        }