/// <summary> /// Creates a new patch operation using the supplied target type and method name, stub method, and patch location. /// </summary> /// <param name="targetType">The target type (in Terraria) that contains the target method.</param> /// <param name="targetMethodName">The name of the target method.</param> /// <param name="stubMethod">The stub method (in your plugin) that will be either prepended or appended to the target method. Must be a static method!</param> /// <param name="patchLocation">Whether the stub method will be prepended as a prefix or appended as a postfix to the target method.</param> /// <param name="patchPriority">The priority of this patch, as used by Harmony to order multiple patches on the same method. Patches with higher numbers go first. Set to -1 to use default priority (typically = 400).</param> protected void CreateHPatchOperation(Type targetType, string targetMethodName, MethodInfo stubMethod, HPatchLocation patchLocation, int patchPriority = -1) { PatchOperations.Add(new HPatchOperation(targetType, targetMethodName, stubMethod, patchLocation, patchPriority)); }
/// <summary> /// Creates a new patch operation using the supplied target method, stub method, and patch location. /// </summary> /// <param name="targetMethod">The target method (in Terraria) that will be patched.</param> /// <param name="stubMethod">The stub method (in your plugin) that will be either prepended or appended to the target method. Must be a static method!</param> /// <param name="patchLocation">Whether the stub method will be prepended as a prefix or appended as a postfix to the target method.</param> /// <param name="patchPriority">The priority of this patch, as used by Harmony to order multiple patches on the same method. Patches with higher numbers go first. Set to -1 to use default priority (typically = 400).</param> protected void CreateHPatchOperation(MethodBase targetMethod, MethodInfo stubMethod, HPatchLocation patchLocation, int patchPriority = -1) { PatchOperations.Add(new HPatchOperation(targetMethod, stubMethod, patchLocation, patchPriority)); }