-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
249 additions
and
85 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using PG.StarWarsGame.Infrastructure.Games; | ||
|
||
namespace ModVerify.CliApp; | ||
|
||
public readonly record struct GameFinderResult(IGame Game, IGame FallbackGame); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
src/PetroglyphTools/PG.StarWarsGame.Engine/FileSystem/GameLocations.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using AnakinRaW.CommonUtilities; | ||
|
||
namespace PG.StarWarsGame.Engine.FileSystem; | ||
|
||
public sealed class GameLocations | ||
{ | ||
public IReadOnlyList<string> ModPaths { get; } | ||
|
||
public string GamePath { get; } | ||
|
||
public IReadOnlyList<string> FallbackPaths { get; } | ||
|
||
public GameLocations(string gamePath, string fallbackGamePath) : this(Array.Empty<string>(), gamePath, fallbackGamePath) | ||
{ | ||
} | ||
|
||
public GameLocations(string modPath, string gamePath, string fallbackGamePath) : this([modPath], gamePath, fallbackGamePath) | ||
{ | ||
ThrowHelper.ThrowIfNullOrEmpty(modPath); | ||
} | ||
|
||
public GameLocations(IList<string> modPaths, string gamePath, string fallbackGamePath) : this(modPaths, | ||
gamePath, [fallbackGamePath]) | ||
{ | ||
ThrowHelper.ThrowIfNullOrEmpty(fallbackGamePath); | ||
} | ||
|
||
public GameLocations(IList<string> modPaths, string gamePath, IList<string> fallbackPaths) | ||
{ | ||
if (modPaths == null) | ||
throw new ArgumentNullException(nameof(modPaths)); | ||
if (fallbackPaths == null) | ||
throw new ArgumentNullException(nameof(fallbackPaths)); | ||
|
||
ModPaths = modPaths.ToList(); | ||
GamePath = gamePath; | ||
FallbackPaths = fallbackPaths.ToList(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.