LevelManager cleanup

This commit is contained in:
Denis-Cosmin Nutiu 2019-08-24 00:38:20 +03:00
parent e4a0b9838c
commit 9b10e457e4

View file

@ -15,27 +15,8 @@ namespace src.Level
private const int XMaxEnemyPosition = 5; private const int XMaxEnemyPosition = 5;
private const int YMinEnemyPosition = -5; private const int YMinEnemyPosition = -5;
public Count DestructibleWallCount
{
get => _destructibleWallCount;
set => _destructibleWallCount = value;
}
public Count UpgradesCount
{
get => _upgradesCount;
set => _upgradesCount = value;
}
public Count EnemyCount
{
get => _enemyCount;
set => _enemyCount = value;
}
/* Used to group spawned objects */ /* Used to group spawned objects */
private Transform _boardHolder; private Transform _boardHolder;
/* Holds the starting position of the player */ /* Holds the starting position of the player */
private Transform _startPosition; private Transform _startPosition;
@ -57,6 +38,8 @@ namespace src.Level
/* Holds the available positions */ /* Holds the available positions */
private readonly List<Vector3> _freeGridPositionsBoard = new List<Vector3>(); private readonly List<Vector3> _freeGridPositionsBoard = new List<Vector3>();
private List<Vector3> _freeGridPositions; private List<Vector3> _freeGridPositions;
/* Holds initialized game objects */
private List<GameObject> _destructibleWalls; private List<GameObject> _destructibleWalls;
private List<GameObject> _enemies; private List<GameObject> _enemies;
@ -163,7 +146,7 @@ namespace src.Level
private void SetupLevelDestructibleWalls() private void SetupLevelDestructibleWalls()
{ {
var numberOfWallsRemaining = _destructibleWallCount.RandomIntRange(); var numberOfWallsRemaining = _destructibleWallCount.RandomIntRange();
List<Vector3> usedPositions = new List<Vector3>(); var usedPositions = new List<Vector3>();
_freeGridPositions.ShuffleList(); _freeGridPositions.ShuffleList();
foreach (var nextPosition in _freeGridPositions) foreach (var nextPosition in _freeGridPositions)
{ {