From fa4f98e4e5b156c8312dc6dcc1e3577da5c0e39e Mon Sep 17 00:00:00 2001 From: Andreas Pardeike Date: Sun, 10 May 2020 11:09:33 +0200 Subject: [PATCH] moves GetSortedPatchMethods to PatchProcessor --- Harmony/Internal/PatchFunctions.cs | 2 +- Harmony/Public/PatchProcessor.cs | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Harmony/Internal/PatchFunctions.cs b/Harmony/Internal/PatchFunctions.cs index 2171bfdd..6ae6ec0c 100644 --- a/Harmony/Internal/PatchFunctions.cs +++ b/Harmony/Internal/PatchFunctions.cs @@ -127,7 +127,7 @@ internal static void RemovePatch(PatchInfo patchInfo, MethodInfo patch) /// Use debug mode /// The sorted patch methods /// - public static List GetSortedPatchMethods(MethodBase original, Patch[] patches, bool debug) + internal static List GetSortedPatchMethods(MethodBase original, Patch[] patches, bool debug) { return new PatchSorter(patches, debug).Sort(original); } diff --git a/Harmony/Public/PatchProcessor.cs b/Harmony/Public/PatchProcessor.cs index 45621b24..45152c08 100644 --- a/Harmony/Public/PatchProcessor.cs +++ b/Harmony/Public/PatchProcessor.cs @@ -210,6 +210,16 @@ public static Patches GetPatchInfo(MethodBase method) return new Patches(patchInfo.prefixes, patchInfo.postfixes, patchInfo.transpilers, patchInfo.finalizers); } + /// Sort patch methods by their priority rules + /// The original method + /// Patches to sort + /// The sorted patch methods + /// + public static List GetSortedPatchMethods(MethodBase original, Patch[] patches) + { + return PatchFunctions.GetSortedPatchMethods(original, patches, false); + } + /// Gets Harmony version for all active Harmony instances /// [out] The current Harmony version /// A dictionary containing assembly version keyed by Harmony ID