public Maze(MazeInitModel model) { _playerName = model.PlayerName; _difficulty = (int)model.Difficulty; _width = model.MazeWidth; _height = model.MazeHeight; _cells = new CellState[_width * _height]; for (var x = 0; x < _height; x++) { for (var y = 0; y < _width; y++) { _cells[(x * _width) + y] = CellState.Initial; } } _rng = new Random(); MazeHelper.VisitCell(this, _rng.Next(_width * _height), _rng); }