Skip to content

Commit

Permalink
Refactor , move some class from Models to Modules
Browse files Browse the repository at this point in the history
  • Loading branch information
charles7668 committed Nov 17, 2024
1 parent 8b80d1d commit 735a7db
Show file tree
Hide file tree
Showing 35 changed files with 65 additions and 47 deletions.
1 change: 0 additions & 1 deletion GameManager/App.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using GameManager.DB;
using GameManager.DB.Models;
using GameManager.Models.TaskManager;
using GameManager.Services;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Infrastructure;
Expand Down
2 changes: 1 addition & 1 deletion GameManager/Components/Layout/MainLayout.razor.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
using GameManager.DB.Models;
using GameManager.Models.TaskManager;
using GameManager.Modules.TaskManager;
using GameManager.Services;
using Hangfire.Annotations;
using Microsoft.AspNetCore.Components;
Expand Down
2 changes: 1 addition & 1 deletion GameManager/Components/Layout/NavMenu.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@using GameManager.Models.TaskManager
@using GameManager.Modules.TaskManager
<MudNavMenu Class="mud-height-full d-flex flex-column">
<MudTooltip Text="@Resources.NavMenu_Game">
<MudNavLink Class="d-flex align-center" Match="NavLinkMatch.All" Icon="@Icons.Material.Filled.GridView" Href="/"></MudNavLink>
Expand Down
2 changes: 1 addition & 1 deletion GameManager/Components/Layout/NavMenu.razor.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using GameManager.Models.TaskManager;
using GameManager.Modules.TaskManager;
using Microsoft.AspNetCore.Components;

namespace GameManager.Components.Layout
Expand Down
2 changes: 1 addition & 1 deletion GameManager/Components/Pages/Home.Razor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using GameManager.Components.Pages.components;
using GameManager.DB.Models;
using GameManager.Enums;
using GameManager.Models.TaskManager;
using GameManager.Modules.TaskManager;
using GameManager.Properties;
using GameManager.Services;
using Helper;
Expand Down
4 changes: 2 additions & 2 deletions GameManager/Components/Pages/Setting.razor.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using GameManager.Components.Pages.components;
using GameManager.DB.Models;
using GameManager.Models;
using GameManager.Models.SecurityProvider;
using GameManager.Models.TaskManager;
using GameManager.Modules.SecurityProvider;
using GameManager.Modules.TaskManager;
using GameManager.Properties;
using GameManager.Services;
using Microsoft.AspNetCore.Components;
Expand Down
2 changes: 1 addition & 1 deletion GameManager/Components/Pages/Tools.razor
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
@page "/tools"
@using GameManager.Models.ToolInfo
@using GameManager.Modules.ToolInfo

<div>
<MudStack Row="true">
Expand Down
2 changes: 1 addition & 1 deletion GameManager/Components/Pages/Tools.razor.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using GameManager.DB.Models;
using GameManager.Models;
using GameManager.Models.ToolInfo;
using GameManager.Modules.ToolInfo;
using GameManager.Services;
using Microsoft.AspNetCore.Components;
using Microsoft.Extensions.Configuration;
Expand Down
2 changes: 1 addition & 1 deletion GameManager/Components/Pages/components/ActionBar.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using GameManager.Enums;
using GameManager.Extractor;
using GameManager.Models;
using GameManager.Models.GameInstallAnalyzer;
using GameManager.Modules.GameInstallAnalyzer;
using GameManager.Properties;
using GameManager.Services;
using Helper;
Expand Down
4 changes: 2 additions & 2 deletions GameManager/Components/Pages/components/Card.razor.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using GameManager.DB.Models;
using GameManager.Models;
using GameManager.Models.LaunchProgramStrategies;
using GameManager.Models.SaveDataManager;
using GameManager.Modules.LaunchProgramStrategies;
using GameManager.Modules.SaveDataManager;
using GameManager.Properties;
using GameManager.Services;
using Helper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using GameManager.DB.Models;
using GameManager.Models;
using GameManager.Models.LaunchProgramStrategies;
using GameManager.Modules.LaunchProgramStrategies;
using GameManager.Properties;
using GameManager.Services;
using Helper;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using GameManager.DB.Models;
using GameManager.Models;
using GameManager.Models.SaveDataManager;
using GameManager.Modules.SaveDataManager;
using Microsoft.AspNetCore.Components;
using MudBlazor;

Expand Down
8 changes: 4 additions & 4 deletions GameManager/Extensions/ServiceCollectionExtension.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
using GameManager.Extractor;
using GameManager.GameInfoProvider;
using GameManager.Models.SecurityProvider;
using GameManager.Models.Synchronizer;
using GameManager.Models.Synchronizer.Drivers;
using GameManager.Models.TaskManager;
using GameManager.Modules.SecurityProvider;
using GameManager.Modules.Synchronizer;
using GameManager.Modules.Synchronizer.Drivers;
using GameManager.Modules.TaskManager;
using GameManager.Services;
using Microsoft.Extensions.DependencyInjection.Extensions;

Expand Down
4 changes: 4 additions & 0 deletions GameManager/GameManager.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,8 @@
</None>
</ItemGroup>

<ItemGroup>
<Folder Include="Modules\" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions GameManager/MauiProgram.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
using GameManager.DB;
using GameManager.Extensions;
using GameManager.Models;
using GameManager.Models.GameInstallAnalyzer;
using GameManager.Models.SaveDataManager;
using GameManager.Modules.GameInstallAnalyzer;
using GameManager.Modules.SaveDataManager;
using GameManager.Services;
using Hangfire;
using Hangfire.MemoryStorage;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace GameManager.Models.GameInstallAnalyzer
using GameManager.Models;

namespace GameManager.Modules.GameInstallAnalyzer
{
public interface IGameInstallAnalyzer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using ABI.Windows.Security.Isolation;
using GameManager.Models;
using System.Text;

namespace GameManager.Models.GameInstallAnalyzer
namespace GameManager.Modules.GameInstallAnalyzer
{
public class ProcessTracerGameInstallAnalyzer : IGameInstallAnalyzer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using GameManager.DB.Models;
using GameManager.Models;
using GameManager.Services;
using System.Diagnostics;

namespace GameManager.Models.LaunchProgramStrategies
namespace GameManager.Modules.LaunchProgramStrategies
{
public class DirectLaunch(GameInfo gameInfo, Action<int>? tryLaunchVNGTTranslator = null) : IStrategy
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using GameManager.DB.Models;
using GameManager.Models;

namespace GameManager.Models.LaunchProgramStrategies
namespace GameManager.Modules.LaunchProgramStrategies
{
public class LaunchProgramStrategyFactory
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using GameManager.DB.Models;
using GameManager.Models;
using GameManager.Properties;
using GameManager.Services;
using System.Diagnostics;
using System.Xml.Linq;
using System.Xml.XPath;

namespace GameManager.Models.LaunchProgramStrategies
namespace GameManager.Modules.LaunchProgramStrategies
{
public class LaunchWithLocaleEmulator(GameInfo gameInfo, Action<int>? tryLaunchVNGTTranslator = null) : IStrategy
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
using GameManager.DB.Models;
using GameManager.Models;
using GameManager.Properties;
using GameManager.Services;
using System.Diagnostics;
using System.Xml.Linq;
using System.Xml.XPath;

namespace GameManager.Models.LaunchProgramStrategies
namespace GameManager.Modules.LaunchProgramStrategies
{
public class LaunchWithSandboxie(GameInfo gameInfo, Action<int>? tryLaunchVNGTTranslator) : IStrategy
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
using GameManager.DB.Models;
using GameManager.DTOs;
using GameManager.Models;

namespace GameManager.Models.SaveDataManager
namespace GameManager.Modules.SaveDataManager
{
public interface ISaveDataManager
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
using GameManager.DB.Models;
using GameManager.DTOs;
using GameManager.Extractor;
using GameManager.Models;
using GameManager.Properties;
using GameManager.Services;
using Helper;
using Microsoft.Extensions.Logging;
using System.IO.Compression;

namespace GameManager.Models.SaveDataManager
namespace GameManager.Modules.SaveDataManager
{
public class SaveDataManager(ILogger<SaveDataManager> logger, IAppPathService appPathService) : ISaveDataManager
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
using System.Security.Cryptography;
using System.Text;

namespace GameManager.Models.SecurityProvider
namespace GameManager.Modules.SecurityProvider
{
public class AESSecurityProvider : ISecurityProvider
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GameManager.Models.SecurityProvider
namespace GameManager.Modules.SecurityProvider
{
public interface ISecurityProvider
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
namespace GameManager.Models.Synchronizer.Drivers
using FileInfo = GameManager.Models.FileInfo;

namespace GameManager.Modules.Synchronizer.Drivers
{
public interface IWebDAVDriver
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
using System.Net;
using System.Text;
using System.Xml;
using FileInfo = GameManager.Models.FileInfo;

namespace GameManager.Models.Synchronizer.Drivers
namespace GameManager.Modules.Synchronizer.Drivers
{
public class WebDAVWebDAVDriver(IWebService webService) : IWebDAVDriver
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GameManager.Models.Synchronizer
namespace GameManager.Modules.Synchronizer
{
public interface ISynchronizer
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using GameManager.DTOs;
using GameManager.Models.SaveDataManager;
using GameManager.Models.SecurityProvider;
using GameManager.Models.Synchronizer.Drivers;
using GameManager.Modules.SaveDataManager;
using GameManager.Modules.SecurityProvider;
using GameManager.Modules.Synchronizer.Drivers;
using GameManager.Services;
using Helper;
using Microsoft.Extensions.Logging;
Expand All @@ -10,9 +10,10 @@
using System.Text.Json;
using System.Web;
using CancellationToken = System.Threading.CancellationToken;
using FileInfo = GameManager.Models.FileInfo;
using InvalidOperationException = System.InvalidOperationException;

namespace GameManager.Models.Synchronizer
namespace GameManager.Modules.Synchronizer
{
public class Synchronizer(
IWebDAVDriver webDAVDriver,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System.Linq.Expressions;
using GameManager.Models;
using System.Linq.Expressions;

namespace GameManager.Models.TaskManager
namespace GameManager.Modules.TaskManager
{
public interface ITaskManager
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using GameManager.Models.Synchronizer;
using GameManager.Modules.Synchronizer;
using JetBrains.Annotations;
using Microsoft.Extensions.Logging;

namespace GameManager.Models.TaskManager
namespace GameManager.Modules.TaskManager
{
public static class TaskExecutor
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Hangfire;
using GameManager.Models;
using Hangfire;
using Hangfire.Storage;
using System.Linq.Expressions;

namespace GameManager.Models.TaskManager
namespace GameManager.Modules.TaskManager
{
public class TaskManager
: ITaskManager
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using GameManager.Extractor;
using GameManager.Models;
using GameManager.Services;
using System.Text.Json;

namespace GameManager.Models.ToolInfo
namespace GameManager.Modules.ToolInfo
{
public class BuiltinToolInfo(
string toolName,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using GameManager.Services;
using System.Diagnostics;

namespace GameManager.Models.ToolInfo
namespace GameManager.Modules.ToolInfo
{
public class CustomToolInfo(string toolName, string toolVersion, string exePath, bool runAsAdmin = false)
: IToolInfo
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace GameManager.Models.ToolInfo
namespace GameManager.Modules.ToolInfo
{
public interface IToolInfo
{
Expand Down

0 comments on commit 735a7db

Please sign in to comment.