Skip to content

Commit 3f79964

Browse files
committed
rename stuff
1 parent 4e04252 commit 3f79964

14 files changed

Lines changed: 77 additions & 91 deletions

src/ModVerify.CliApp/ModSelectors/IVerificationTargetSelector.cs

Lines changed: 0 additions & 8 deletions
This file was deleted.

src/ModVerify.CliApp/ModSelectors/SettingsBasedVerificationTargetCreator.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/ModVerify.CliApp/ModVerifyApplication.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using AET.ModVerify.App.ModSelectors;
2-
using AET.ModVerify.App.Reporting;
1+
using AET.ModVerify.App.Reporting;
32
using AET.ModVerify.App.Settings;
43
using AET.ModVerify.Pipeline;
54
using AET.ModVerify.Reporting;
@@ -16,6 +15,7 @@
1615
using System.Linq;
1716
using System.Threading.Tasks;
1817
using AET.ModVerify.App.GameFinder;
18+
using AET.ModVerify.App.TargetSelectors;
1919
using ILogger = Microsoft.Extensions.Logging.ILogger;
2020

2121
namespace AET.ModVerify.App;
@@ -71,7 +71,7 @@ private async Task<int> RunVerify()
7171
VerificationTarget verificationTarget;
7272
try
7373
{
74-
var targetSettings = settings.GameInstallationsSettings;
74+
var targetSettings = settings.VerificationTargetSettings;
7575
verificationTarget = new VerificationTargetSelectorFactory(services)
7676
.CreateSelector(targetSettings)
7777
.Select(targetSettings);

src/ModVerify.CliApp/Settings/CommandLine/BaseModVerifyOptions.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ internal abstract class BaseModVerifyOptions
2121
public string? Suppressions { get; init; }
2222

2323
[Option("path", SetName = "autoDetection", Required = false, Default = null,
24-
HelpText = "Specifies the path to verify. The path may be a game or mod. The application will try to find all necessary sub-mods or base games itself. " +
24+
HelpText = "Specifies the path to verify. The path may be a game or mod. The application will try to find all necessary sub-mods and base games itself. " +
2525
"The argument cannot be combined with any of --mods, --game or --fallbackGame")]
26-
public string? AutoPath { get; init; }
26+
public string? TargetPath { get; init; }
2727

2828
[Option("mods", SetName = "manualPaths", Required = false, Default = null, Separator = ';',
2929
HelpText = "The path of the mod to verify. To support submods, multiple paths can be separated using the ';' (semicolon) character. " +

src/ModVerify.CliApp/Settings/ModVerifyAppSettings.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ namespace AET.ModVerify.App.Settings;
66

77
internal sealed class ModVerifyAppSettings
88
{
9-
public bool Interactive => GameInstallationsSettings.Interactive;
9+
public bool Interactive => VerificationTargetSettings.Interactive;
1010

1111
public required VerifyPipelineSettings VerifyPipelineSettings { get; init; }
1212

1313
public required ModVerifyReportSettings ReportSettings { get; init; }
1414

15-
public required GameInstallationsSettings GameInstallationsSettings { get; init; }
15+
public required VerificationTargetSettings VerificationTargetSettings { get; init; }
1616

1717
public VerificationSeverity? AppThrowsOnMinimumSeverity { get; init; }
1818

src/ModVerify.CliApp/Settings/SettingsBuilder.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ private ModVerifyAppSettings BuildFromVerifyVerb(VerifyVerbOption verifyOptions)
4444
}
4545
},
4646
AppThrowsOnMinimumSeverity = verifyOptions.MinimumFailureSeverity,
47-
GameInstallationsSettings = BuildInstallationSettings(verifyOptions),
47+
VerificationTargetSettings = BuildInstallationSettings(verifyOptions),
4848
ReportSettings = BuildReportSettings(verifyOptions),
4949
};
5050

@@ -85,7 +85,7 @@ private ModVerifyAppSettings BuildFromCreateBaselineVerb(CreateBaselineVerbOptio
8585
FailFast = false,
8686
},
8787
AppThrowsOnMinimumSeverity = null,
88-
GameInstallationsSettings = BuildInstallationSettings(baselineVerb),
88+
VerificationTargetSettings = BuildInstallationSettings(baselineVerb),
8989
ReportSettings = BuildReportSettings(baselineVerb),
9090
NewBaselinePath = baselineVerb.OutputFile,
9191
};
@@ -111,7 +111,7 @@ static bool SearchLocally(BaseModVerifyOptions o)
111111
}
112112
}
113113

114-
private GameInstallationsSettings BuildInstallationSettings(BaseModVerifyOptions options)
114+
private VerificationTargetSettings BuildInstallationSettings(BaseModVerifyOptions options)
115115
{
116116
var modPaths = new List<string>();
117117
if (options.ModPaths is not null)
@@ -142,13 +142,13 @@ private GameInstallationsSettings BuildInstallationSettings(BaseModVerifyOptions
142142
if (!string.IsNullOrEmpty(gamePath) && !string.IsNullOrEmpty(options.FallbackGamePath))
143143
fallbackGamePath = _fileSystem.Path.GetFullPath(options.FallbackGamePath!);
144144

145-
var autoPath = options.AutoPath;
146-
if (!string.IsNullOrEmpty(autoPath))
147-
autoPath = _fileSystem.Path.GetFullPath(autoPath!);
145+
var targetPath = options.TargetPath;
146+
if (!string.IsNullOrEmpty(targetPath))
147+
targetPath = _fileSystem.Path.GetFullPath(targetPath!);
148148

149-
return new GameInstallationsSettings
149+
return new VerificationTargetSettings
150150
{
151-
AutoPath = autoPath,
151+
TargetPath = targetPath,
152152
ModPaths = modPaths,
153153
GamePath = gamePath,
154154
FallbackGamePath = fallbackGamePath,

src/ModVerify.CliApp/Settings/GameInstallationsSettings.cs renamed to src/ModVerify.CliApp/Settings/VerificationTargetSettings.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@
44

55
namespace AET.ModVerify.App.Settings;
66

7-
internal sealed record GameInstallationsSettings
7+
internal sealed record VerificationTargetSettings
88
{
9-
public bool Interactive => string.IsNullOrEmpty(AutoPath) && ModPaths.Count == 0 && string.IsNullOrEmpty(GamePath);
9+
public bool Interactive => string.IsNullOrEmpty(TargetPath) && ModPaths.Count == 0 && string.IsNullOrEmpty(GamePath) && string.IsNullOrEmpty(FallbackGamePath);
1010

11-
[MemberNotNullWhen(true, nameof(AutoPath))]
12-
public bool UseAutoDetection => !string.IsNullOrEmpty(AutoPath);
11+
[MemberNotNullWhen(true, nameof(TargetPath))]
12+
public bool UseAutoDetection => !string.IsNullOrEmpty(TargetPath);
1313

1414
[MemberNotNullWhen(true, nameof(GamePath))]
1515
public bool ManualSetup => !string.IsNullOrEmpty(GamePath);
1616

17-
public string? AutoPath { get; init; }
17+
public string? TargetPath { get; init; }
1818

1919
public IReadOnlyList<string> ModPaths { get; init; } = [];
2020

src/ModVerify.CliApp/ModSelectors/AutomaticSelector.cs renamed to src/ModVerify.CliApp/TargetSelectors/AutomaticSelector.cs

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,16 @@
1414
using PG.StarWarsGame.Infrastructure.Services;
1515
using PG.StarWarsGame.Infrastructure.Services.Detection;
1616

17-
namespace AET.ModVerify.App.ModSelectors;
17+
namespace AET.ModVerify.App.TargetSelectors;
1818

1919
internal class AutomaticSelector(IServiceProvider serviceProvider) : VerificationTargetSelectorBase(serviceProvider)
2020
{
2121
private readonly IFileSystem _fileSystem = serviceProvider.GetRequiredService<IFileSystem>();
2222

23-
public override VerificationTarget Select(GameInstallationsSettings settings)
23+
internal override SelectionResult SelectTarget(
24+
VerificationTargetSettings settings)
2425
{
25-
var targetPath = settings.AutoPath;
26+
var targetPath = settings.TargetPath;
2627
if (targetPath is null)
2728
throw new InvalidOperationException("path to verify cannot be null.");
2829

@@ -44,7 +45,7 @@ public override VerificationTarget Select(GameInstallationsSettings settings)
4445

4546
var targetObject = GetAttachedModOrGame(finderResult, engine, targetPath);
4647

47-
48+
4849
if (targetObject is null)
4950
{
5051
if (!settings.Engine.HasValue)
@@ -64,15 +65,8 @@ public override VerificationTarget Select(GameInstallationsSettings settings)
6465
throw new ArgumentException($"The specified game type '{engine}' does not match the actual type of the game or mod to verify.");
6566
locations = GetLocations(targetObject, finderResult.FallbackGame, settings.AdditionalFallbackPaths);
6667
}
67-
68-
return new VerificationTarget
69-
{
70-
Engine = engine.Value,
71-
Location = locations,
72-
Name = GetTargetName(targetObject, locations),
73-
Version = GetTargetVersion(targetObject)
74-
};
75-
68+
69+
return new(locations, engine.Value, targetObject);
7670
}
7771

7872
private IPhysicalPlayableObject? GetAttachedModOrGame(GameFinderResult finderResult, GameEngineType? requestedEngineType, string targetPath)
@@ -101,7 +95,7 @@ public override VerificationTarget Select(GameInstallationsSettings settings)
10195
GetMatchingModFromGame(finderResult.FallbackGame, requestedEngineType, targetFullPath);
10296
}
10397

104-
private GameLocations GetDetachedModLocations(string modPath, GameFinderResult gameResult, GameInstallationsSettings settings, out IPhysicalMod mod)
98+
private GameLocations GetDetachedModLocations(string modPath, GameFinderResult gameResult, VerificationTargetSettings settings, out IPhysicalMod mod)
10599
{
106100
IGame game = null!;
107101

src/ModVerify.CliApp/ModSelectors/ConsoleSelector.cs renamed to src/ModVerify.CliApp/TargetSelectors/ConsoleSelector.cs

Lines changed: 5 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,17 @@
99
using PG.StarWarsGame.Infrastructure.Games;
1010
using PG.StarWarsGame.Infrastructure.Mods;
1111

12-
namespace AET.ModVerify.App.ModSelectors;
12+
namespace AET.ModVerify.App.TargetSelectors;
1313

1414
internal class ConsoleSelector(IServiceProvider serviceProvider) : VerificationTargetSelectorBase(serviceProvider)
1515
{
16-
public override VerificationTarget Select(GameInstallationsSettings settings)
16+
internal override SelectionResult SelectTarget(VerificationTargetSettings settings)
1717
{
1818
var gameResult = GameFinderService.FindGames(GameFinderSettings.Default);
19-
var targetObject = SelectPlayableObject(gameResult);
19+
var targetObject = SelectPlayableObject(gameResult);
2020
var engine = targetObject.Game.Type.ToEngineType();
21-
22-
var gameLocations = GetLocations(targetObject, gameResult.FallbackGame, settings.AdditionalFallbackPaths);
23-
24-
return new VerificationTarget
25-
{
26-
Engine = engine,
27-
Location = gameLocations,
28-
Name = GetTargetName(targetObject, gameLocations),
29-
Version = GetTargetVersion(targetObject)
30-
};
21+
var locations = GetLocations(targetObject, gameResult.FallbackGame, settings.AdditionalFallbackPaths);
22+
return new(locations, engine, targetObject);
3123
}
3224

3325
private static IPhysicalPlayableObject SelectPlayableObject(GameFinderResult finderResult)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
using AET.ModVerify.App.Settings;
2+
3+
namespace AET.ModVerify.App.TargetSelectors;
4+
5+
internal interface IVerificationTargetSelector
6+
{
7+
VerificationTarget Select(VerificationTargetSettings settings);
8+
}

0 commit comments

Comments
 (0)