Skip to content

Commit d4c92a3

Browse files
committed
started major refactor
1 parent 33f2b4d commit d4c92a3

27 files changed

+384
-143
lines changed

MiniMapLibrary/Interfaces/IConfig.cs renamed to MiniMapLibrary/Config/Interfaces/IConfig.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using System.Text;
44

5-
namespace MiniMapLibrary.Interfaces
5+
namespace MiniMapLibrary.Config
66
{
77
public interface IConfig
88
{

MiniMapLibrary/Interfaces/IConfigEntry.cs renamed to MiniMapLibrary/Config/Interfaces/IConfigEntry.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using System.Collections.Generic;
33
using System.Text;
44

5-
namespace MiniMapLibrary.Interfaces
5+
namespace MiniMapLibrary.Config
66
{
77
public interface IConfigEntry<T>
88
{

MiniMapLibrary/Interfaces/wrappers/SettingConfigGroup.cs renamed to MiniMapLibrary/Config/Interfaces/ISettingConfigGroup.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
using MiniMapLibrary.Interfaces;
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Text;
54
using UnityEngine;
65

7-
namespace MiniMapMod.wrappers
6+
namespace MiniMapLibrary.Config
87
{
98
public interface ISettingConfigGroup
109
{

MiniMapLibrary/SettingConfigGroup.cs renamed to MiniMapLibrary/Config/SettingConfigGroup.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
using MiniMapLibrary;
2-
using MiniMapLibrary.Interfaces;
2+
using MiniMapLibrary.Config;
33
using System;
44
using System.Collections.Generic;
55
using System.Text;
66
using UnityEngine;
77

8-
namespace MiniMapMod.wrappers
8+
namespace MiniMapLibrary.Config
99
{
1010
public class SettingConfigGroup : ISettingConfigGroup
1111
{

MiniMapLibrary/StubConfigEntry.cs renamed to MiniMapLibrary/Config/wrappers/StubConfigEntry.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
using MiniMapLibrary.Interfaces;
2-
using System;
1+
using System;
32
using System.Collections.Generic;
43
using System.Text;
54

6-
namespace MiniMapLibrary
5+
namespace MiniMapLibrary.Config
76
{
87
public class StubConfigEntry<T> : IConfigEntry<T>
98
{

MiniMapLibrary/Interactible/InteractibleSetting.cs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using MiniMapLibrary.Interfaces;
2-
using MiniMapMod.wrappers;
1+
using MiniMapLibrary.Config;
32
using System;
43
using System.Collections.Generic;
54
using System.Text;
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
namespace MiniMapLibrary
6+
{
7+
public interface ILogger
8+
{
9+
void LogDebug(object data);
10+
void LogError(object data);
11+
void LogFatal(object data);
12+
void LogInfo(object data);
13+
void LogMessage(object data);
14+
void LogWarning(object data);
15+
void LogException(Exception head, string message = "");
16+
}
17+
}
File renamed without changes.

MiniMapLibrary/MiniMapLibrary.csproj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,16 @@
88
<PackageReference Include="Unity3D" Version="1.7.0" />
99
</ItemGroup>
1010

11+
<ItemGroup>
12+
<Reference Include="UnityEngine">
13+
<HintPath>..\MiniMapMod\libs\UnityEngine.dll</HintPath>
14+
</Reference>
15+
<Reference Include="UnityEngine">
16+
<HintPath>..\MiniMapMod\libs\UnityEngine.CoreModule.dll</HintPath>
17+
</Reference>
18+
<Reference Include="UnityEngine.UI">
19+
<HintPath>..\MiniMapMod\libs\UnityEngine.UI.dll</HintPath>
20+
</Reference>
21+
</ItemGroup>
22+
1123
</Project>
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Text;
4+
5+
#nullable enable
6+
namespace MiniMapLibrary.Scanner
7+
{
8+
public class DefaultSorter<T> : ISorter<T>
9+
{
10+
public InteractableKind Kind { get; set; }
11+
12+
private readonly Func<T, bool>? selector;
13+
14+
public DefaultSorter(InteractableKind kind, Func<T, bool>? selector = null)
15+
{
16+
Kind = kind;
17+
this.selector = selector;
18+
}
19+
20+
public bool IsKind(T value) => selector?.Invoke(value) ?? false;
21+
}
22+
}

0 commit comments

Comments
 (0)