diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-05 22:15:38 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-05-05 22:15:38 -0400 |
commit | 7a60e6d2a1fbddc60a4052ba577e4f64c35736b3 (patch) | |
tree | 91ffcef7e93ade849df8b3cff34f02b23c4cb47a /src/SMAPI/Framework/Patching | |
parent | 499cd8ab317080096c373c6ed6649bd51fb01c7d (diff) | |
download | SMAPI-7a60e6d2a1fbddc60a4052ba577e4f64c35736b3.tar.gz SMAPI-7a60e6d2a1fbddc60a4052ba577e4f64c35736b3.tar.bz2 SMAPI-7a60e6d2a1fbddc60a4052ba577e4f64c35736b3.zip |
migrate to Harmony 2.0 finalizers (#711)
Diffstat (limited to 'src/SMAPI/Framework/Patching')
-rw-r--r-- | src/SMAPI/Framework/Patching/PatchHelper.cs | 34 |
1 files changed, 0 insertions, 34 deletions
diff --git a/src/SMAPI/Framework/Patching/PatchHelper.cs b/src/SMAPI/Framework/Patching/PatchHelper.cs deleted file mode 100644 index 4cb436f0..00000000 --- a/src/SMAPI/Framework/Patching/PatchHelper.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace StardewModdingAPI.Framework.Patching -{ - /// <summary>Provides generic methods for implementing Harmony patches.</summary> - internal class PatchHelper - { - /********* - ** Fields - *********/ - /// <summary>The interception keys currently being intercepted.</summary> - private static readonly HashSet<string> InterceptingKeys = new HashSet<string>(StringComparer.OrdinalIgnoreCase); - - - /********* - ** Public methods - *********/ - /// <summary>Track a method that will be intercepted.</summary> - /// <param name="key">The intercept key.</param> - /// <returns>Returns false if the method was already marked for interception, else true.</returns> - public static bool StartIntercept(string key) - { - return PatchHelper.InterceptingKeys.Add(key); - } - - /// <summary>Track a method as no longer being intercepted.</summary> - /// <param name="key">The intercept key.</param> - public static void StopIntercept(string key) - { - PatchHelper.InterceptingKeys.Remove(key); - } - } -} |