From 4df199985558caee3275fdd65762bdc3e1d040c6 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sat, 26 Nov 2016 16:10:41 -0500 Subject: move cache struct into its own file (#166) --- .../Framework/AssemblyRewriting/CachePaths.cs | 33 ++++++++++++++++++++ .../Framework/ModAssemblyLoader.cs | 35 +--------------------- 2 files changed, 34 insertions(+), 34 deletions(-) create mode 100644 src/StardewModdingAPI/Framework/AssemblyRewriting/CachePaths.cs (limited to 'src/StardewModdingAPI/Framework') 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 +{ + /// Contains the paths for an assembly's cached data. + internal struct CachePaths + { + /********* + ** Accessors + *********/ + /// The directory path which contains the assembly. + public string Directory { get; } + + /// The file path of the assembly file. + public string Assembly { get; } + + /// The file path containing the MD5 hash for the assembly. + public string Hash { get; } + + + /********* + ** Public methods + *********/ + /// Construct an instance. + /// The directory path which contains the assembly. + /// The file path of the assembly file. + /// The file path containing the MD5 hash for the assembly. + 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 - *********/ - /// Contains the paths for an assembly's cached data. - private struct CachePaths - { - /********* - ** Accessors - *********/ - /// The directory path which contains the assembly. - public string Directory { get; } - - /// The file path of the assembly file. - public string Assembly { get; } - - /// The file path containing the MD5 hash for the assembly. - public string Hash { get; } - - - /********* - ** Public methods - *********/ - /// Construct an instance. - /// The directory path which contains the assembly. - /// The file path of the assembly file. - /// The file path containing the MD5 hash for the assembly. - public CachePaths(string directory, string assembly, string hash) - { - this.Directory = directory; - this.Assembly = assembly; - this.Hash = hash; - } - } } } -- cgit