From 0485d9097c16d8ef50dff38bc8d26a89f9b9159b Mon Sep 17 00:00:00 2001 From: MSWS Date: Sat, 31 Aug 2024 04:46:15 -0700 Subject: [PATCH] Move Mock into Impl --- Gangs.sln | 2 +- .../Mock/.idea/.idea.Mock.dir/.idea/.gitignore | 13 +++++++++++++ .../Mock/.idea/.idea.Mock.dir/.idea/encodings.xml | 4 ++++ .../Mock/.idea/.idea.Mock.dir/.idea/indexLayout.xml | 8 ++++++++ GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/vcs.xml | 6 ++++++ {Mock => GangsImpl/Mock}/MemoryImpl.cs | 2 +- {Mock => GangsImpl/Mock}/Mock.csproj | 5 +---- {Mock => GangsImpl/Mock}/MockGang.cs | 2 +- {Mock => GangsImpl/Mock}/MockGangManager.cs | 2 +- {Mock => GangsImpl/Mock}/MockGangRank.cs | 2 +- {Mock => GangsImpl/Mock}/MockInstanceStatManager.cs | 2 +- {Mock => GangsImpl/Mock}/MockPlayer.cs | 2 +- {Mock => GangsImpl/Mock}/MockPlayerManager.cs | 2 +- {Mock => GangsImpl/Mock}/MockStat.cs | 2 +- {Mock => GangsImpl/Mock}/MockStatManager.cs | 2 +- GangsImpl/SQLite/SQLiteStatManager.cs | 2 +- GangsTest/GangTests/GangManagerData.cs | 2 +- GangsTest/GangTests/GangManagerTests.cs | 2 +- GangsTest/GangTests/GangMutabilityTests.cs | 2 +- GangsTest/GangsTest.csproj | 3 +-- GangsTest/Startup.cs | 2 +- GangsTest/StatTests/StatManagerData.cs | 4 ++-- 22 files changed, 50 insertions(+), 23 deletions(-) create mode 100644 GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/.gitignore create mode 100644 GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/encodings.xml create mode 100644 GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/indexLayout.xml create mode 100644 GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/vcs.xml rename {Mock => GangsImpl/Mock}/MemoryImpl.cs (90%) rename {Mock => GangsImpl/Mock}/Mock.csproj (85%) rename {Mock => GangsImpl/Mock}/MockGang.cs (97%) rename {Mock => GangsImpl/Mock}/MockGangManager.cs (97%) rename {Mock => GangsImpl/Mock}/MockGangRank.cs (90%) rename {Mock => GangsImpl/Mock}/MockInstanceStatManager.cs (98%) rename {Mock => GangsImpl/Mock}/MockPlayer.cs (93%) rename {Mock => GangsImpl/Mock}/MockPlayerManager.cs (96%) rename {Mock => GangsImpl/Mock}/MockStat.cs (97%) rename {Mock => GangsImpl/Mock}/MockStatManager.cs (97%) diff --git a/Gangs.sln b/Gangs.sln index 65969ee..f0fe52f 100644 --- a/Gangs.sln +++ b/Gangs.sln @@ -6,7 +6,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GangsPlugin", "GangsPlugin\ EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GangsTest", "GangsTest\GangsTest.csproj", "{B1D1E7C7-BDF3-4238-9025-4FEB2B7DAB89}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mock", "Mock\Mock.csproj", "{140E1706-30E8-4440-AAA0-56E8DD32F054}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mock", "GangsImpl\Mock\Mock.csproj", "{140E1706-30E8-4440-AAA0-56E8DD32F054}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GangsImpl", "GangsImpl", "{3AB7703F-880F-4A41-96EE-B891FA888C65}" EndProject diff --git a/GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/.gitignore b/GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/.gitignore new file mode 100644 index 0000000..de9aa46 --- /dev/null +++ b/GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/.gitignore @@ -0,0 +1,13 @@ +# Default ignored files +/shelf/ +/workspace.xml +# Rider ignored files +/projectSettingsUpdater.xml +/.idea.Mock.iml +/modules.xml +/contentModel.xml +# Editor-based HTTP Client requests +/httpRequests/ +# Datasource local storage ignored files +/dataSources/ +/dataSources.local.xml diff --git a/GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/encodings.xml b/GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/encodings.xml new file mode 100644 index 0000000..df87cf9 --- /dev/null +++ b/GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/indexLayout.xml b/GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/indexLayout.xml new file mode 100644 index 0000000..7b08163 --- /dev/null +++ b/GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/indexLayout.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/vcs.xml b/GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/vcs.xml new file mode 100644 index 0000000..6c0b863 --- /dev/null +++ b/GangsImpl/Mock/.idea/.idea.Mock.dir/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/Mock/MemoryImpl.cs b/GangsImpl/Mock/MemoryImpl.cs similarity index 90% rename from Mock/MemoryImpl.cs rename to GangsImpl/Mock/MemoryImpl.cs index 35f48e9..f9ca1d7 100644 --- a/Mock/MemoryImpl.cs +++ b/GangsImpl/Mock/MemoryImpl.cs @@ -2,7 +2,7 @@ using GangsAPI.Services; using Microsoft.Extensions.DependencyInjection; -namespace GangsImpl.Memory; +namespace Mock; public static class MemoryImpl { public static void AddMemoryImpl(this IServiceCollection collection) { diff --git a/Mock/Mock.csproj b/GangsImpl/Mock/Mock.csproj similarity index 85% rename from Mock/Mock.csproj rename to GangsImpl/Mock/Mock.csproj index c57f62a..3467255 100644 --- a/Mock/Mock.csproj +++ b/GangsImpl/Mock/Mock.csproj @@ -4,10 +4,6 @@ net8.0 enable enable - - false - true - GangsImpl.Memory @@ -23,6 +19,7 @@ + diff --git a/Mock/MockGang.cs b/GangsImpl/Mock/MockGang.cs similarity index 97% rename from Mock/MockGang.cs rename to GangsImpl/Mock/MockGang.cs index f202401..0aeb410 100644 --- a/Mock/MockGang.cs +++ b/GangsImpl/Mock/MockGang.cs @@ -2,7 +2,7 @@ using GangsAPI.Data.Stat; using GangsAPI.Permissions; -namespace GangsImpl.Memory; +namespace Mock; public class MockGang : IGang { public MockGang(int id, string name, ulong owner) { diff --git a/Mock/MockGangManager.cs b/GangsImpl/Mock/MockGangManager.cs similarity index 97% rename from Mock/MockGangManager.cs rename to GangsImpl/Mock/MockGangManager.cs index 05d6ed3..7ca028b 100644 --- a/Mock/MockGangManager.cs +++ b/GangsImpl/Mock/MockGangManager.cs @@ -1,7 +1,7 @@ using GangsAPI.Data.Gang; using GangsAPI.Services; -namespace GangsImpl.Memory; +namespace Mock; public class MockGangManager : IGangManager { private readonly HashSet gangs = []; diff --git a/Mock/MockGangRank.cs b/GangsImpl/Mock/MockGangRank.cs similarity index 90% rename from Mock/MockGangRank.cs rename to GangsImpl/Mock/MockGangRank.cs index 6e72805..da9cdd1 100644 --- a/Mock/MockGangRank.cs +++ b/GangsImpl/Mock/MockGangRank.cs @@ -1,6 +1,6 @@ using GangsAPI.Permissions; -namespace GangsImpl.Memory; +namespace Mock; public class MockGangRank(int rank, string name, IGangRank.Permissions perms = 0) : IGangRank { diff --git a/Mock/MockInstanceStatManager.cs b/GangsImpl/Mock/MockInstanceStatManager.cs similarity index 98% rename from Mock/MockInstanceStatManager.cs rename to GangsImpl/Mock/MockInstanceStatManager.cs index c293e19..48b95c6 100644 --- a/Mock/MockInstanceStatManager.cs +++ b/GangsImpl/Mock/MockInstanceStatManager.cs @@ -1,7 +1,7 @@ using GangsAPI.Data.Stat; using GangsAPI.Services; -namespace GangsImpl.Memory; +namespace Mock; public class MockInstanceStatManager(IStatManager mgr) : IPlayerStatManager, IGangStatManager { diff --git a/Mock/MockPlayer.cs b/GangsImpl/Mock/MockPlayer.cs similarity index 93% rename from Mock/MockPlayer.cs rename to GangsImpl/Mock/MockPlayer.cs index 320fe5e..c156386 100644 --- a/Mock/MockPlayer.cs +++ b/GangsImpl/Mock/MockPlayer.cs @@ -2,7 +2,7 @@ using GangsAPI.Data.Stat; using GangsAPI.Permissions; -namespace GangsImpl.Memory; +namespace Mock; public class MockPlayer(ulong steam) : IGangPlayer { public ulong Steam { get; } = steam; diff --git a/Mock/MockPlayerManager.cs b/GangsImpl/Mock/MockPlayerManager.cs similarity index 96% rename from Mock/MockPlayerManager.cs rename to GangsImpl/Mock/MockPlayerManager.cs index 4da8299..739c07a 100644 --- a/Mock/MockPlayerManager.cs +++ b/GangsImpl/Mock/MockPlayerManager.cs @@ -1,7 +1,7 @@ using GangsAPI.Data.Gang; using GangsAPI.Services; -namespace GangsImpl.Memory; +namespace Mock; public class MockPlayerManager : IPlayerManager { private readonly Dictionary players = new(); diff --git a/Mock/MockStat.cs b/GangsImpl/Mock/MockStat.cs similarity index 97% rename from Mock/MockStat.cs rename to GangsImpl/Mock/MockStat.cs index e67ae78..f6a5a2a 100644 --- a/Mock/MockStat.cs +++ b/GangsImpl/Mock/MockStat.cs @@ -1,6 +1,6 @@ using GangsAPI.Data.Stat; -namespace GangsImpl.Memory; +namespace Mock; public class MockStat(string statId, string name, string? desc) : IStat { public string StatId { get; } = statId; diff --git a/Mock/MockStatManager.cs b/GangsImpl/Mock/MockStatManager.cs similarity index 97% rename from Mock/MockStatManager.cs rename to GangsImpl/Mock/MockStatManager.cs index af5fbba..7fad9d3 100644 --- a/Mock/MockStatManager.cs +++ b/GangsImpl/Mock/MockStatManager.cs @@ -1,7 +1,7 @@ using GangsAPI.Data.Stat; using GangsAPI.Services; -namespace GangsImpl.Memory; +namespace Mock; public class MockStatManager : IStatManager { private readonly HashSet cachedStats = [], backendStats = []; diff --git a/GangsImpl/SQLite/SQLiteStatManager.cs b/GangsImpl/SQLite/SQLiteStatManager.cs index 1343a13..b980625 100644 --- a/GangsImpl/SQLite/SQLiteStatManager.cs +++ b/GangsImpl/SQLite/SQLiteStatManager.cs @@ -2,7 +2,7 @@ using GenericDB; using Microsoft.Data.Sqlite; -namespace GangsImpl.SQLLite; +namespace SQLite; public class SQLiteStatManager(string connectionString, string table = "gang_stats", bool testing = false) diff --git a/GangsTest/GangTests/GangManagerData.cs b/GangsTest/GangTests/GangManagerData.cs index 9b4297c..3e77809 100644 --- a/GangsTest/GangTests/GangManagerData.cs +++ b/GangsTest/GangTests/GangManagerData.cs @@ -1,6 +1,6 @@ using System.Collections; using GangsAPI; -using GangsImpl.Memory; +using Mock; namespace GangsTest.GangTests; diff --git a/GangsTest/GangTests/GangManagerTests.cs b/GangsTest/GangTests/GangManagerTests.cs index 7852bad..d59af5a 100644 --- a/GangsTest/GangTests/GangManagerTests.cs +++ b/GangsTest/GangTests/GangManagerTests.cs @@ -1,5 +1,5 @@ using GangsAPI.Services; -using GangsImpl.Memory; +using Mock; namespace GangsTest.GangTests; diff --git a/GangsTest/GangTests/GangMutabilityTests.cs b/GangsTest/GangTests/GangMutabilityTests.cs index b68c007..86c9046 100644 --- a/GangsTest/GangTests/GangMutabilityTests.cs +++ b/GangsTest/GangTests/GangMutabilityTests.cs @@ -1,5 +1,5 @@ using GangsAPI.Services; -using GangsImpl.Memory; +using Mock; namespace GangsTest.GangTests; diff --git a/GangsTest/GangsTest.csproj b/GangsTest/GangsTest.csproj index e836b3f..b94cbea 100644 --- a/GangsTest/GangsTest.csproj +++ b/GangsTest/GangsTest.csproj @@ -19,7 +19,6 @@ - @@ -29,7 +28,7 @@ - + diff --git a/GangsTest/Startup.cs b/GangsTest/Startup.cs index c668b2a..83d4092 100644 --- a/GangsTest/Startup.cs +++ b/GangsTest/Startup.cs @@ -1,6 +1,6 @@ using GangsAPI.Services; -using GangsImpl.Memory; using Microsoft.Extensions.DependencyInjection; +using Mock; namespace GangsTest; diff --git a/GangsTest/StatTests/StatManagerData.cs b/GangsTest/StatTests/StatManagerData.cs index 0f94e0b..d79baf4 100644 --- a/GangsTest/StatTests/StatManagerData.cs +++ b/GangsTest/StatTests/StatManagerData.cs @@ -1,8 +1,8 @@ using System.Collections; using GangsAPI; -using GangsImpl.Memory; -using GangsImpl.SQLLite; +using Mock; using SQLImpl; +using SQLite; namespace GangsTest.StatTests;