diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/StardewModdingAPI/Framework/AssemblyRewriting/CachePaths.cs | 33 | ||||
-rw-r--r-- | src/StardewModdingAPI/Framework/ModAssemblyLoader.cs | 35 | ||||
-rw-r--r-- | src/StardewModdingAPI/StardewModdingAPI.csproj | 1 |
3 files changed, 35 insertions, 34 deletions
diff --git a/src/StardewModdingAPI/Framework/AssemblyRewriting/CachePaths.cs b/src/StardewModdingAPI/Framework/AssemblyRewriting/CachePaths.cs new file mode 100644 index 00000000..17c4d188 --- /dev/null +++ b/src/StardewModdingAPI/Framework/AssemblyRewriting/CachePaths.cs @@ -0,0 +1,33 @@ +namespace StardewModdingAPI.Framework.AssemblyRewriting +{ + /// <summary>Contains the paths for an assembly's cached data.</summary> + internal struct CachePaths + { + /********* + ** Accessors + *********/ + /// <summary>The directory path which contains the assembly.</summary> + public string Directory { get; } + + /// <summary>The file path of the assembly file.</summary> + public string Assembly { get; } + + /// <summary>The file path containing the MD5 hash for the assembly.</summary> + public string Hash { get; } + + + /********* + ** Public methods + *********/ + /// <summary>Construct an instance.</summary> + /// <param name="directory">The directory path which contains the assembly.</param> + /// <param name="assembly">The file path of the assembly file.</param> + /// <param name="hash">The file path containing the MD5 hash for the assembly.</param> + public CachePaths(string directory, string assembly, string hash) + { + this.Directory = directory; + this.Assembly = assembly; + this.Hash = hash; + } + } +}
\ No newline at end of file diff --git a/src/StardewModdingAPI/Framework/ModAssemblyLoader.cs b/src/StardewModdingAPI/Framework/ModAssemblyLoader.cs index e5a73a8b..bde23e3b 100644 --- a/src/StardewModdingAPI/Framework/ModAssemblyLoader.cs +++ b/src/StardewModdingAPI/Framework/ModAssemblyLoader.cs @@ -4,6 +4,7 @@ using System.Linq; using System.Reflection; using System.Security.Cryptography; using Mono.Cecil; +using StardewModdingAPI.Framework.AssemblyRewriting; namespace StardewModdingAPI.Framework { @@ -91,39 +92,5 @@ namespace StardewModdingAPI.Framework string cacheHashPath = Path.Combine(dirPath, $"{key}.hash"); return new CachePaths(dirPath, cacheAssemblyPath, cacheHashPath); } - - /********* - ** Private objects - *********/ - /// <summary>Contains the paths for an assembly's cached data.</summary> - private struct CachePaths - { - /********* - ** Accessors - *********/ - /// <summary>The directory path which contains the assembly.</summary> - public string Directory { get; } - - /// <summary>The file path of the assembly file.</summary> - public string Assembly { get; } - - /// <summary>The file path containing the MD5 hash for the assembly.</summary> - public string Hash { get; } - - - /********* - ** Public methods - *********/ - /// <summary>Construct an instance.</summary> - /// <param name="directory">The directory path which contains the assembly.</param> - /// <param name="assembly">The file path of the assembly file.</param> - /// <param name="hash">The file path containing the MD5 hash for the assembly.</param> - public CachePaths(string directory, string assembly, string hash) - { - this.Directory = directory; - this.Assembly = assembly; - this.Hash = hash; - } - } } } diff --git a/src/StardewModdingAPI/StardewModdingAPI.csproj b/src/StardewModdingAPI/StardewModdingAPI.csproj index 01be9a68..c835df42 100644 --- a/src/StardewModdingAPI/StardewModdingAPI.csproj +++ b/src/StardewModdingAPI/StardewModdingAPI.csproj @@ -213,6 +213,7 @@ <Compile Include="Events\PlayerEvents.cs" /> <Compile Include="Events\TimeEvents.cs" /> <Compile Include="Extensions.cs" /> + <Compile Include="Framework\AssemblyRewriting\CachePaths.cs" /> <Compile Include="Framework\DeprecationLevel.cs" /> <Compile Include="Framework\DeprecationManager.cs" /> <Compile Include="Framework\InternalExtensions.cs" /> |