diff options
author | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-02-04 15:30:46 -0500 |
---|---|---|
committer | Jesse Plamondon-Willard <github@jplamondonw.com> | 2017-02-04 15:30:46 -0500 |
commit | 9c9833c9086b758589dafee10243e3bf47e12d73 (patch) | |
tree | 65c279c65e6edd598844b2dc41ad6e141fc48dd9 /src/StardewModdingAPI/Framework/AssemblyRewriting/CacheEntry.cs | |
parent | e9cb691251668af87f25549fdedaf382e820075f (diff) | |
parent | 3919ab7a4aed7acd579e471f5660df5fbc890ae2 (diff) | |
download | SMAPI-9c9833c9086b758589dafee10243e3bf47e12d73.tar.gz SMAPI-9c9833c9086b758589dafee10243e3bf47e12d73.tar.bz2 SMAPI-9c9833c9086b758589dafee10243e3bf47e12d73.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/StardewModdingAPI/Framework/AssemblyRewriting/CacheEntry.cs')
-rw-r--r-- | src/StardewModdingAPI/Framework/AssemblyRewriting/CacheEntry.cs | 61 |
1 files changed, 0 insertions, 61 deletions
diff --git a/src/StardewModdingAPI/Framework/AssemblyRewriting/CacheEntry.cs b/src/StardewModdingAPI/Framework/AssemblyRewriting/CacheEntry.cs deleted file mode 100644 index 4c3b86fe..00000000 --- a/src/StardewModdingAPI/Framework/AssemblyRewriting/CacheEntry.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.IO; -using StardewModdingAPI.AssemblyRewriters; - -namespace StardewModdingAPI.Framework.AssemblyRewriting -{ - /// <summary>Represents cached metadata for a rewritten assembly.</summary> - internal class CacheEntry - { - /********* - ** Accessors - *********/ - /// <summary>The MD5 hash for the original assembly.</summary> - public readonly string Hash; - - /// <summary>The SMAPI version used to rewrite the assembly.</summary> - public readonly string ApiVersion; - - /// <summary>The target platform.</summary> - public readonly Platform Platform; - - /// <summary>The <see cref="System.Environment.MachineName"/> value for the machine used to rewrite the assembly.</summary> - public readonly string MachineName; - - /// <summary>Whether to use the cached assembly instead of the original assembly.</summary> - public readonly bool UseCachedAssembly; - - - /********* - ** Public methods - *********/ - /// <summary>Construct an instance.</summary> - /// <param name="hash">The MD5 hash for the original assembly.</param> - /// <param name="apiVersion">The SMAPI version used to rewrite the assembly.</param> - /// <param name="platform">The target platform.</param> - /// <param name="machineName">The <see cref="System.Environment.MachineName"/> value for the machine used to rewrite the assembly.</param> - /// <param name="useCachedAssembly">Whether to use the cached assembly instead of the original assembly.</param> - public CacheEntry(string hash, string apiVersion, Platform platform, string machineName, bool useCachedAssembly) - { - this.Hash = hash; - this.ApiVersion = apiVersion; - this.Platform = platform; - this.MachineName = machineName; - this.UseCachedAssembly = useCachedAssembly; - } - - /// <summary>Get whether the cache entry is up-to-date for the given assembly hash.</summary> - /// <param name="paths">The paths for the cached assembly.</param> - /// <param name="hash">The MD5 hash of the original assembly.</param> - /// <param name="currentVersion">The current SMAPI version.</param> - /// <param name="platform">The target platform.</param> - /// <param name="machineName">The <see cref="System.Environment.MachineName"/> value for the machine reading the assembly.</param> - public bool IsUpToDate(CachePaths paths, string hash, ISemanticVersion currentVersion, Platform platform, string machineName) - { - return hash == this.Hash - && this.ApiVersion == currentVersion.ToString() - && this.Platform == platform - && this.MachineName == machineName - && (!this.UseCachedAssembly || File.Exists(paths.Assembly)); - } - } -}
\ No newline at end of file |