Cleanup BombUtilManager
This commit is contained in:
parent
22af655678
commit
52a7a536c8
1 changed files with 7 additions and 11 deletions
|
@ -49,25 +49,21 @@ namespace src.Managers
|
||||||
|
|
||||||
public void RegisterBomb(Vector3 position)
|
public void RegisterBomb(Vector3 position)
|
||||||
{
|
{
|
||||||
if (CanPlaceBomb(position))
|
if (!CanPlaceBomb(position)) return;
|
||||||
{
|
placedBombs++;
|
||||||
placedBombs++;
|
_usedPosition.Add(position);
|
||||||
_usedPosition.Add(position);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UnregisterBomb(Vector3 position)
|
public void UnregisterBomb(Vector3 position)
|
||||||
{
|
{
|
||||||
if (_usedPosition.Contains(position))
|
if (!_usedPosition.Contains(position)) return;
|
||||||
{
|
placedBombs--;
|
||||||
placedBombs--;
|
_usedPosition.Remove(position);
|
||||||
_usedPosition.Remove(position);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool CanPlaceBomb(Vector3 position)
|
public bool CanPlaceBomb(Vector3 position)
|
||||||
{
|
{
|
||||||
return (!_usedPosition.Contains(position) && (placedBombs < allowedBombs));
|
return !_usedPosition.Contains(position) && placedBombs < allowedBombs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue