From 52a7a536c840b9bb5ff3ec2d7a41b3fc56a8bbc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nu=C8=9Biu?= Date: Sat, 24 Aug 2019 19:27:32 +0300 Subject: [PATCH] Cleanup BombUtilManager --- .../Scripts/src/Managers/BombsUtilManager.cs | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/Assets/Scripts/src/Managers/BombsUtilManager.cs b/Assets/Scripts/src/Managers/BombsUtilManager.cs index 9a9cc37..4f45c86 100644 --- a/Assets/Scripts/src/Managers/BombsUtilManager.cs +++ b/Assets/Scripts/src/Managers/BombsUtilManager.cs @@ -49,25 +49,21 @@ namespace src.Managers public void RegisterBomb(Vector3 position) { - if (CanPlaceBomb(position)) - { - placedBombs++; - _usedPosition.Add(position); - } + if (!CanPlaceBomb(position)) return; + placedBombs++; + _usedPosition.Add(position); } public void UnregisterBomb(Vector3 position) { - if (_usedPosition.Contains(position)) - { - placedBombs--; - _usedPosition.Remove(position); - } + if (!_usedPosition.Contains(position)) return; + placedBombs--; + _usedPosition.Remove(position); } public bool CanPlaceBomb(Vector3 position) { - return (!_usedPosition.Contains(position) && (placedBombs < allowedBombs)); + return !_usedPosition.Contains(position) && placedBombs < allowedBombs; } } } \ No newline at end of file