From 391af7efb2ba8d8a3575fa96972b0e9217be5fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Nu=C8=9Biu?= Date: Sun, 28 Jul 2019 19:31:01 +0300 Subject: [PATCH] Extract Count into Helper class --- Assets/Scripts/src/Helpers/Count.cs | 21 +++++++++++++++++++++ Assets/Scripts/src/Helpers/Count.cs.meta | 3 +++ Assets/Scripts/src/Managers/LevelManager.cs | 17 ----------------- 3 files changed, 24 insertions(+), 17 deletions(-) create mode 100644 Assets/Scripts/src/Helpers/Count.cs create mode 100644 Assets/Scripts/src/Helpers/Count.cs.meta diff --git a/Assets/Scripts/src/Helpers/Count.cs b/Assets/Scripts/src/Helpers/Count.cs new file mode 100644 index 0000000..d044c06 --- /dev/null +++ b/Assets/Scripts/src/Helpers/Count.cs @@ -0,0 +1,21 @@ +using UnityEngine; + +namespace src.Helpers +{ + public class Count + { + private readonly int _min; + private readonly int _max; + + public Count(int min, int max) + { + _min = min; + _max = max; + } + + public int RandomIntRange() + { + return Mathf.FloorToInt(Random.Range(_min, _max)); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/src/Helpers/Count.cs.meta b/Assets/Scripts/src/Helpers/Count.cs.meta new file mode 100644 index 0000000..a17b6b6 --- /dev/null +++ b/Assets/Scripts/src/Helpers/Count.cs.meta @@ -0,0 +1,3 @@ +fileFormatVersion: 2 +guid: a2787d1c344641e3a5509f691156eab7 +timeCreated: 1564331210 \ No newline at end of file diff --git a/Assets/Scripts/src/Managers/LevelManager.cs b/Assets/Scripts/src/Managers/LevelManager.cs index ab9e24e..5976480 100644 --- a/Assets/Scripts/src/Managers/LevelManager.cs +++ b/Assets/Scripts/src/Managers/LevelManager.cs @@ -10,23 +10,6 @@ namespace src.Managers { public class LevelManager : GameplayComponent { - public class Count - { - private readonly int _min; - private readonly int _max; - - public Count(int min, int max) - { - _min = min; - _max = max; - } - - public int RandomIntRange() - { - return Mathf.FloorToInt(Random.Range(_min, _max)); - } - } - public Count DestructibleWallCount { get => _destructibleWallCount;