Exemple #1
0
        private void ExecuteGame(ICardGame game)
        {
            int roundCounter = 1;

            do
            {
                this.textInterface.Clear();
                this.textInterface.WriteLine($"Round {roundCounter}");
                this.textInterface.WriteLine();

                game.ExecuteRound();

                roundCounter++;
                if (!game.IsGameOver())
                {
                    this.textInterface.WriteLine();
                    this.textInterface.Write($"Press {this.continueRoundKey} to continue. ");
                    this.textInterface.ReadSingleCharFromList(new[] { this.continueRoundKey });
                    this.textInterface.Backspace();
                }
            }while (!game.IsGameOver());

            this.HandleGameOver(game);
        }