Skip to content

Commit

Permalink
adds HarmonyPatch for private methods
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Mar 12, 2022
1 parent 909ac2e commit 941e464
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Harmony/Public/Attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,18 @@ public HarmonyPatch(Type[] argumentTypes, ArgumentType[] argumentVariations)
ParseSpecialArguments(argumentTypes, argumentVariations);
}

/// <summary>An annotation that specifies a method, property or constructor to patch</summary>
/// <param name="typeName">The full name of the declaring class/type</param>
/// <param name="methodName">The name of the method, property or constructor to patch</param>
/// <param name="methodType">The <see cref="MethodType"/></param>
///
public HarmonyPatch(string typeName, string methodName, MethodType methodType = MethodType.Normal)
{
info.declaringType = AccessTools.TypeByName(typeName);
info.methodName = methodName;
info.methodType = methodType;
}

void ParseSpecialArguments(Type[] argumentTypes, ArgumentType[] argumentVariations)
{
if (argumentVariations is null || argumentVariations.Length == 0)
Expand Down

0 comments on commit 941e464

Please sign in to comment.