/// <summary>
    /// Game is initialized with given difficulty.
    /// New GameModel is created accordingly and passed to GamePresenter.
    /// </summary>
    /// <param name="difficulty">Game Difficulty</param>
    private void InitializeGame(GameDifficulty difficulty)
    {
        _gameModel = new GameModel( );
        switch (difficulty)
        {
        case GameDifficulty.Easy:
            _gameModel._gridSize.row    = 5;
            _gameModel._gridSize.column = 3;
            _gameModel._numberOfBombs   = 3;
            break;

        case GameDifficulty.Medium:
            _gameModel._gridSize.row    = 7;
            _gameModel._gridSize.column = 5;
            _gameModel._numberOfBombs   = 6;
            break;

        case GameDifficulty.Hard:
            _gameModel._gridSize.row    = 10;
            _gameModel._gridSize.column = 6;
            _gameModel._numberOfBombs   = 8;
            break;

        default:
            break;
        }

        _gamePresenter.Initialize(_gameModel);
        _detailsPresenter.DisplayMineCount(_gameModel._numberOfBombs);
    }
Exemple #2
0
    /// <summary>
    /// Game is initialized with given difficulty.
    /// New GameModel is created accordingly and passed to GamePresenter.
    /// </summary>
    /// <param name="difficulty">Game Difficulty</param>
    private void InitializeGame(GameDifficulty difficulty)
    {
        switch (difficulty)
        {
        case GameDifficulty.Easy:
            _totalRowCount    = 5;
            _totalColumnCount = 3;
            _totalMineCount   = 3;
            break;

        case GameDifficulty.Medium:
            _totalRowCount    = 7;
            _totalColumnCount = 5;
            _totalMineCount   = 6;
            break;

        case GameDifficulty.Hard:
            _totalRowCount    = 10;
            _totalColumnCount = 6;
            _totalMineCount   = 8;
            break;

        default:
            break;
        }

        _detailsPresenter.DisplayMineCount(_totalMineCount);
        CreateGame(_totalRowCount, _totalColumnCount, _totalMineCount);
    }