From 6e8a93e1ab23069118a5fb790736c396fe47e6cc Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 2 Nov 2025 11:12:43 +0000 Subject: [PATCH] Separate service interfaces and implementations into dedicated folders Reorganized the Services directory structure to improve code organization: - Created Services/Interfaces folder for all service interfaces (I*.cs) - Created Services/Implementations folder for all service implementations - Updated all namespaces: - GLMod.Services.Interfaces for interface files - GLMod.Services.Implementations for implementation files - Updated using statements in GLMod.cs and MainMenuManagerPatch.cs This separation provides better separation of concerns and makes the architecture more maintainable. --- GLMod/EventPatch/MainMenuManagerPatch.cs | 2 +- GLMod/GLMod.cs | 3 ++- GLMod/Services/{ => Implementations}/AuthenticationService.cs | 3 ++- GLMod/Services/{ => Implementations}/ConfigurationService.cs | 3 ++- GLMod/Services/{ => Implementations}/GameStateManager.cs | 3 ++- GLMod/Services/{ => Implementations}/IntegrityService.cs | 3 ++- GLMod/Services/{ => Implementations}/ItemService.cs | 3 ++- GLMod/Services/{ => Implementations}/MapService.cs | 3 ++- GLMod/Services/{ => Implementations}/RankService.cs | 3 ++- GLMod/Services/{ => Implementations}/ServiceManager.cs | 3 ++- GLMod/Services/{ => Implementations}/TranslationService.cs | 3 ++- GLMod/Services/{ => Interfaces}/IAuthenticationService.cs | 2 +- GLMod/Services/{ => Interfaces}/IConfigurationService.cs | 2 +- GLMod/Services/{ => Interfaces}/IGameStateManager.cs | 2 +- GLMod/Services/{ => Interfaces}/IIntegrityService.cs | 2 +- GLMod/Services/{ => Interfaces}/IItemService.cs | 2 +- GLMod/Services/{ => Interfaces}/IMapService.cs | 2 +- GLMod/Services/{ => Interfaces}/IRankService.cs | 2 +- GLMod/Services/{ => Interfaces}/IServiceManager.cs | 2 +- GLMod/Services/{ => Interfaces}/ITranslationService.cs | 2 +- 20 files changed, 30 insertions(+), 20 deletions(-) rename GLMod/Services/{ => Implementations}/AuthenticationService.cs (98%) rename GLMod/Services/{ => Implementations}/ConfigurationService.cs (96%) rename GLMod/Services/{ => Implementations}/GameStateManager.cs (99%) rename GLMod/Services/{ => Implementations}/IntegrityService.cs (99%) rename GLMod/Services/{ => Implementations}/ItemService.cs (98%) rename GLMod/Services/{ => Implementations}/MapService.cs (95%) rename GLMod/Services/{ => Implementations}/RankService.cs (97%) rename GLMod/Services/{ => Implementations}/ServiceManager.cs (95%) rename GLMod/Services/{ => Implementations}/TranslationService.cs (98%) rename GLMod/Services/{ => Interfaces}/IAuthenticationService.cs (97%) rename GLMod/Services/{ => Interfaces}/IConfigurationService.cs (95%) rename GLMod/Services/{ => Interfaces}/IGameStateManager.cs (98%) rename GLMod/Services/{ => Interfaces}/IIntegrityService.cs (98%) rename GLMod/Services/{ => Interfaces}/IItemService.cs (97%) rename GLMod/Services/{ => Interfaces}/IMapService.cs (90%) rename GLMod/Services/{ => Interfaces}/IRankService.cs (93%) rename GLMod/Services/{ => Interfaces}/IServiceManager.cs (98%) rename GLMod/Services/{ => Interfaces}/ITranslationService.cs (97%) diff --git a/GLMod/EventPatch/MainMenuManagerPatch.cs b/GLMod/EventPatch/MainMenuManagerPatch.cs index 225d170..4c79b66 100644 --- a/GLMod/EventPatch/MainMenuManagerPatch.cs +++ b/GLMod/EventPatch/MainMenuManagerPatch.cs @@ -1,7 +1,7 @@ using BepInEx.Unity.IL2CPP.Utils; using GLMod.Class; using GLMod.GLEntities; -using GLMod.Services; +using GLMod.Services.Interfaces; using HarmonyLib; using Steamworks; using System; diff --git a/GLMod/GLMod.cs b/GLMod/GLMod.cs index c9f0df9..7160e07 100644 --- a/GLMod/GLMod.cs +++ b/GLMod/GLMod.cs @@ -9,7 +9,8 @@ using System.Linq; using GLMod.Enums; using GLMod.Constants; -using GLMod.Services; +using GLMod.Services.Interfaces; +using GLMod.Services.Implementations; using Random = System.Random; using GLMod.GLEntities; using GLMod.Class; diff --git a/GLMod/Services/AuthenticationService.cs b/GLMod/Services/Implementations/AuthenticationService.cs similarity index 98% rename from GLMod/Services/AuthenticationService.cs rename to GLMod/Services/Implementations/AuthenticationService.cs index 5f5125a..c889ae4 100644 --- a/GLMod/Services/AuthenticationService.cs +++ b/GLMod/Services/Implementations/AuthenticationService.cs @@ -1,12 +1,13 @@ using BepInEx.Configuration; using GLMod.Class; using GLMod.Constants; +using GLMod.Services.Interfaces; using Steamworks; using System; using System.Collections; using System.Collections.Generic; -namespace GLMod.Services +namespace GLMod.Services.Implementations { /// /// Handles user authentication and session management diff --git a/GLMod/Services/ConfigurationService.cs b/GLMod/Services/Implementations/ConfigurationService.cs similarity index 96% rename from GLMod/Services/ConfigurationService.cs rename to GLMod/Services/Implementations/ConfigurationService.cs index 7686ef1..5a2fd06 100644 --- a/GLMod/Services/ConfigurationService.cs +++ b/GLMod/Services/Implementations/ConfigurationService.cs @@ -1,9 +1,10 @@ using BepInEx.Logging; +using GLMod.Services.Interfaces; using GLMod.Constants; using System; using System.IO; -namespace GLMod.Services +namespace GLMod.Services.Implementations { /// /// Service responsible for managing mod configuration diff --git a/GLMod/Services/GameStateManager.cs b/GLMod/Services/Implementations/GameStateManager.cs similarity index 99% rename from GLMod/Services/GameStateManager.cs rename to GLMod/Services/Implementations/GameStateManager.cs index 0100dd0..f014dbb 100644 --- a/GLMod/Services/GameStateManager.cs +++ b/GLMod/Services/Implementations/GameStateManager.cs @@ -1,4 +1,5 @@ using AmongUs.GameOptions; +using GLMod.Services.Interfaces; using BepInEx.Configuration; using BepInEx.Logging; using BepInEx.Unity.IL2CPP.Utils.Collections; @@ -16,7 +17,7 @@ using System.Threading.Tasks; using UnityEngine; -namespace GLMod.Services +namespace GLMod.Services.Implementations { /// /// Service responsible for managing game state and flow diff --git a/GLMod/Services/IntegrityService.cs b/GLMod/Services/Implementations/IntegrityService.cs similarity index 99% rename from GLMod/Services/IntegrityService.cs rename to GLMod/Services/Implementations/IntegrityService.cs index 08e4a40..4680f43 100644 --- a/GLMod/Services/IntegrityService.cs +++ b/GLMod/Services/Implementations/IntegrityService.cs @@ -1,4 +1,5 @@ using BepInEx; +using GLMod.Services.Interfaces; using BepInEx.Logging; using GLMod.Class; using System; @@ -10,7 +11,7 @@ using System.Threading.Tasks; using System.Net.Http; -namespace GLMod.Services +namespace GLMod.Services.Implementations { /// /// Service responsible for file integrity verification diff --git a/GLMod/Services/ItemService.cs b/GLMod/Services/Implementations/ItemService.cs similarity index 98% rename from GLMod/Services/ItemService.cs rename to GLMod/Services/Implementations/ItemService.cs index 11cd173..59ccc0c 100644 --- a/GLMod/Services/ItemService.cs +++ b/GLMod/Services/Implementations/ItemService.cs @@ -1,4 +1,5 @@ using BepInEx.Logging; +using GLMod.Services.Interfaces; using GLMod.Class; using GLMod.GLEntities; using System; @@ -6,7 +7,7 @@ using System.Collections.Generic; using System.Linq; -namespace GLMod.Services +namespace GLMod.Services.Implementations { /// /// Service responsible for managing items and DLC ownership diff --git a/GLMod/Services/MapService.cs b/GLMod/Services/Implementations/MapService.cs similarity index 95% rename from GLMod/Services/MapService.cs rename to GLMod/Services/Implementations/MapService.cs index 4705132..43ebcc7 100644 --- a/GLMod/Services/MapService.cs +++ b/GLMod/Services/Implementations/MapService.cs @@ -1,9 +1,10 @@ using AmongUs.GameOptions; +using GLMod.Services.Interfaces; using BepInEx.Logging; using GLMod.Enums; using System; -namespace GLMod.Services +namespace GLMod.Services.Implementations { /// /// Service responsible for map-related operations diff --git a/GLMod/Services/RankService.cs b/GLMod/Services/Implementations/RankService.cs similarity index 97% rename from GLMod/Services/RankService.cs rename to GLMod/Services/Implementations/RankService.cs index 15a9369..23cdc93 100644 --- a/GLMod/Services/RankService.cs +++ b/GLMod/Services/Implementations/RankService.cs @@ -1,11 +1,12 @@ using BepInEx.Logging; +using GLMod.Services.Interfaces; using GLMod.Class; using GLMod.GLEntities; using System; using System.Collections; using System.Collections.Generic; -namespace GLMod.Services +namespace GLMod.Services.Implementations { /// /// Service responsible for managing player ranks diff --git a/GLMod/Services/ServiceManager.cs b/GLMod/Services/Implementations/ServiceManager.cs similarity index 95% rename from GLMod/Services/ServiceManager.cs rename to GLMod/Services/Implementations/ServiceManager.cs index ef86212..4a05c18 100644 --- a/GLMod/Services/ServiceManager.cs +++ b/GLMod/Services/Implementations/ServiceManager.cs @@ -1,7 +1,8 @@ using GLMod.Enums; +using GLMod.Services.Interfaces; using System.Collections.Generic; -namespace GLMod.Services +namespace GLMod.Services.Implementations { /// /// Service responsible for managing enabled/disabled services diff --git a/GLMod/Services/TranslationService.cs b/GLMod/Services/Implementations/TranslationService.cs similarity index 98% rename from GLMod/Services/TranslationService.cs rename to GLMod/Services/Implementations/TranslationService.cs index d288ded..765ae50 100644 --- a/GLMod/Services/TranslationService.cs +++ b/GLMod/Services/Implementations/TranslationService.cs @@ -1,4 +1,5 @@ using GLMod.Class; +using GLMod.Services.Interfaces; using GLMod.Constants; using GLMod.GLEntities; using System; @@ -6,7 +7,7 @@ using System.Collections.Generic; using System.Linq; -namespace GLMod.Services +namespace GLMod.Services.Implementations { /// /// Handles translations and language management diff --git a/GLMod/Services/IAuthenticationService.cs b/GLMod/Services/Interfaces/IAuthenticationService.cs similarity index 97% rename from GLMod/Services/IAuthenticationService.cs rename to GLMod/Services/Interfaces/IAuthenticationService.cs index d48cfec..be08776 100644 --- a/GLMod/Services/IAuthenticationService.cs +++ b/GLMod/Services/Interfaces/IAuthenticationService.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace GLMod.Services +namespace GLMod.Services.Interfaces { /// /// Interface for authentication and user session management diff --git a/GLMod/Services/IConfigurationService.cs b/GLMod/Services/Interfaces/IConfigurationService.cs similarity index 95% rename from GLMod/Services/IConfigurationService.cs rename to GLMod/Services/Interfaces/IConfigurationService.cs index 3df25c7..3a18a23 100644 --- a/GLMod/Services/IConfigurationService.cs +++ b/GLMod/Services/Interfaces/IConfigurationService.cs @@ -1,4 +1,4 @@ -namespace GLMod.Services +namespace GLMod.Services.Interfaces { /// /// Interface for managing mod configuration diff --git a/GLMod/Services/IGameStateManager.cs b/GLMod/Services/Interfaces/IGameStateManager.cs similarity index 98% rename from GLMod/Services/IGameStateManager.cs rename to GLMod/Services/Interfaces/IGameStateManager.cs index f737932..a485331 100644 --- a/GLMod/Services/IGameStateManager.cs +++ b/GLMod/Services/Interfaces/IGameStateManager.cs @@ -3,7 +3,7 @@ using System.Collections; using System.Collections.Generic; -namespace GLMod.Services +namespace GLMod.Services.Interfaces { /// /// Interface for managing game state and flow diff --git a/GLMod/Services/IIntegrityService.cs b/GLMod/Services/Interfaces/IIntegrityService.cs similarity index 98% rename from GLMod/Services/IIntegrityService.cs rename to GLMod/Services/Interfaces/IIntegrityService.cs index db0ae43..6478d01 100644 --- a/GLMod/Services/IIntegrityService.cs +++ b/GLMod/Services/Interfaces/IIntegrityService.cs @@ -1,6 +1,6 @@ using System.Collections; -namespace GLMod.Services +namespace GLMod.Services.Interfaces { /// /// Interface for managing file integrity verification diff --git a/GLMod/Services/IItemService.cs b/GLMod/Services/Interfaces/IItemService.cs similarity index 97% rename from GLMod/Services/IItemService.cs rename to GLMod/Services/Interfaces/IItemService.cs index e4818bd..b50544a 100644 --- a/GLMod/Services/IItemService.cs +++ b/GLMod/Services/Interfaces/IItemService.cs @@ -2,7 +2,7 @@ using System.Collections; using System.Collections.Generic; -namespace GLMod.Services +namespace GLMod.Services.Interfaces { /// /// Interface for managing items and DLC ownership diff --git a/GLMod/Services/IMapService.cs b/GLMod/Services/Interfaces/IMapService.cs similarity index 90% rename from GLMod/Services/IMapService.cs rename to GLMod/Services/Interfaces/IMapService.cs index 7187cd3..51df582 100644 --- a/GLMod/Services/IMapService.cs +++ b/GLMod/Services/Interfaces/IMapService.cs @@ -1,4 +1,4 @@ -namespace GLMod.Services +namespace GLMod.Services.Interfaces { /// /// Interface for managing map-related operations diff --git a/GLMod/Services/IRankService.cs b/GLMod/Services/Interfaces/IRankService.cs similarity index 93% rename from GLMod/Services/IRankService.cs rename to GLMod/Services/Interfaces/IRankService.cs index 0de5393..d9e1355 100644 --- a/GLMod/Services/IRankService.cs +++ b/GLMod/Services/Interfaces/IRankService.cs @@ -1,7 +1,7 @@ using GLMod.GLEntities; using System.Collections; -namespace GLMod.Services +namespace GLMod.Services.Interfaces { /// /// Interface for managing player ranks diff --git a/GLMod/Services/IServiceManager.cs b/GLMod/Services/Interfaces/IServiceManager.cs similarity index 98% rename from GLMod/Services/IServiceManager.cs rename to GLMod/Services/Interfaces/IServiceManager.cs index e0ad18c..6799643 100644 --- a/GLMod/Services/IServiceManager.cs +++ b/GLMod/Services/Interfaces/IServiceManager.cs @@ -1,7 +1,7 @@ using GLMod.Enums; using System.Collections.Generic; -namespace GLMod.Services +namespace GLMod.Services.Interfaces { /// /// Interface for managing enabled services diff --git a/GLMod/Services/ITranslationService.cs b/GLMod/Services/Interfaces/ITranslationService.cs similarity index 97% rename from GLMod/Services/ITranslationService.cs rename to GLMod/Services/Interfaces/ITranslationService.cs index c614ff6..9cc2cb5 100644 --- a/GLMod/Services/ITranslationService.cs +++ b/GLMod/Services/Interfaces/ITranslationService.cs @@ -2,7 +2,7 @@ using System.Collections; using System.Collections.Generic; -namespace GLMod.Services +namespace GLMod.Services.Interfaces { /// /// Interface for managing translations and languages