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(); }
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); }