public void RunGame() { var keepPlaying = true; _displayManager.DisplayInstructions(); _displayManager.PromptWaitAnyInput(); _inputManager.WaitForAnyInput(); while (keepPlaying) { var gameState = _gameBuilder.Build(MAX_GRID_ROWS, MAX_GRID_COLUMNS, MAX_PLAYER_LIVES, MAX_MINES); _displayManager.DisplayGameState(gameState); var gameEnded = false; while (!gameEnded) { _displayManager.PromptControlGuidance(); var playerDirection = EnsurePlayerDirection(); _gameStateProcessor.PlayStep(gameState, playerDirection); _displayManager.DisplayGameState(gameState); if (gameState.HasWon()) { gameEnded = true; _displayManager.DisplayWin(gameState); } if (gameState.HasLost()) { gameEnded = true; _displayManager.DisplayGameOver(gameState); } } _displayManager.PromptPlayAgain(); keepPlaying = _inputManager.GetYesNoResponse(); } }