summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Framework/AssemblyRewriting/RewriteResult.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI/Framework/AssemblyRewriting/RewriteResult.cs')
-rw-r--r--src/StardewModdingAPI/Framework/AssemblyRewriting/RewriteResult.cs49
1 files changed, 49 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Framework/AssemblyRewriting/RewriteResult.cs b/src/StardewModdingAPI/Framework/AssemblyRewriting/RewriteResult.cs
new file mode 100644
index 00000000..8f34bb20
--- /dev/null
+++ b/src/StardewModdingAPI/Framework/AssemblyRewriting/RewriteResult.cs
@@ -0,0 +1,49 @@
+namespace StardewModdingAPI.Framework.AssemblyRewriting
+{
+ /// <summary>Metadata about a preprocessed assembly.</summary>
+ internal class RewriteResult
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The original assembly path.</summary>
+ public readonly string OriginalAssemblyPath;
+
+ /// <summary>The cache paths.</summary>
+ public readonly CachePaths CachePaths;
+
+ /// <summary>The rewritten assembly bytes.</summary>
+ public readonly byte[] AssemblyBytes;
+
+ /// <summary>The MD5 hash for the original assembly.</summary>
+ public readonly string Hash;
+
+ /// <summary>Whether to use the cached assembly instead of the original assembly.</summary>
+ public readonly bool UseCachedAssembly;
+
+ /// <summary>Whether this data is newer than the cache.</summary>
+ public readonly bool IsNewerThanCache;
+
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ /// <param name="originalAssemblyPath"></param>
+ /// <param name="cachePaths">The cache paths.</param>
+ /// <param name="assemblyBytes">The rewritten assembly bytes.</param>
+ /// <param name="hash">The MD5 hash for the original assembly.</param>
+ /// <param name="useCachedAssembly">Whether to use the cached assembly instead of the original assembly.</param>
+ /// <param name="isNewerThanCache">Whether this data is newer than the cache.</param>
+ public RewriteResult(string originalAssemblyPath, CachePaths cachePaths, byte[] assemblyBytes, string hash, bool useCachedAssembly, bool isNewerThanCache)
+ {
+ this.OriginalAssemblyPath = originalAssemblyPath;
+ this.CachePaths = cachePaths;
+ this.Hash = hash;
+ this.AssemblyBytes = assemblyBytes;
+ this.UseCachedAssembly = useCachedAssembly;
+ this.IsNewerThanCache = isNewerThanCache;
+ }
+ }
+}