Exemple #1
0
        private void HandleGameOver(ICardGame game)
        {
            this.textInterface.WriteLine();
            if (this.textInterface.GetYesOrNoResponse("Play again?"))
            {
                game.RestartGame();

                this.textInterface.WriteLine();
                if (!this.textInterface.GetYesOrNoResponse("Keep the same players again?"))
                {
                    this.textInterface.Clear();
                    var newPlayers = this.playerCollectionFactory.Create();
                    game.SetPlayers(newPlayers);
                }

                this.ExecuteGame(game);
            }
            else
            {
                this.Exit();
            }
        }