Skip to content

Commit 0669f4f

Browse files
committed
started major refactor
1 parent d4c92a3 commit 0669f4f

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

MiniMapMod/Minimap.cs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@
99

1010
namespace MiniMapLibrary
1111
{
12-
public class Minimap
12+
public partial class Minimap
1313
{
14-
// ignore naming violation, name was chosen because unity style uses the same name
15-
#pragma warning disable IDE1006
14+
private readonly MiniMapLibrary.ILogger Logger;
15+
16+
public Minimap(ILogger logger)
17+
{
18+
Logger = logger;
19+
}
20+
1621
public static GameObject gameObject { get; private set; }
17-
#pragma warning restore IDE1006
1822

1923
public static GameObject Container { get; private set; }
2024

@@ -29,6 +33,7 @@ public void CreateMinimap(ISpriteManager spriteManager, GameObject Parent)
2933
return;
3034
}
3135

36+
// set created flag
3237
Created = true;
3338

3439
gameObject = CreateMask();
@@ -50,7 +55,7 @@ public void Destroy()
5055
return;
5156
}
5257

53-
Log.LogDebug("Destroying minimap gameobject");
58+
Logger.LogDebug("Destroying minimap gameobject");
5459
GameObject.Destroy(gameObject);
5560

5661
gameObject = null;
@@ -85,8 +90,8 @@ public RectTransform CreateIcon(InteractableKind type, Vector3 minimapPosition,
8590
}
8691
catch (MissingComponentException e)
8792
{
88-
Log.LogError($"Failed to get sprite for type {type}");
89-
Log.LogError(e.Message);
93+
Logger.LogError($"Failed to get sprite for type {type}");
94+
Logger.LogError(e.Message);
9095

9196
return null;
9297
}

0 commit comments

Comments
 (0)