summaryrefslogtreecommitdiff
path: root/src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs')
-rw-r--r--src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs b/src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs
new file mode 100644
index 00000000..2cf14704
--- /dev/null
+++ b/src/SMAPI.Toolkit/Utilities/PathLookups/MinimalPathLookup.cs
@@ -0,0 +1,31 @@
+namespace StardewModdingAPI.Toolkit.Utilities.PathLookups
+{
+ /// <summary>An API for relative path lookups within a root directory with minimal preprocessing.</summary>
+ internal class MinimalPathLookup : IFilePathLookup
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>A singleton instance for reuse.</summary>
+ public static readonly MinimalPathLookup Instance = new();
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <inheritdoc />
+ public string GetFilePath(string relativePath)
+ {
+ return PathUtilities.NormalizePath(relativePath);
+ }
+
+ /// <inheritdoc />
+ public string GetAssetName(string relativePath)
+ {
+ return PathUtilities.NormalizeAssetName(relativePath);
+ }
+
+ /// <inheritdoc />
+ public void Add(string relativePath) { }
+ }
+}