docs/api/HarmonyLib.Patch.html
A serializable patch
System.Object
Patch
public class Patch : IComparable
Creates a patch
public Patch(HarmonyMethod method, int index, string owner)
| Type | Name | Description |
|---|---|---|
| HarmonyMethod | method |
The method of the patch
| | System.Int32 | index |
Zero-based index
| | System.String | owner |
An owner (Harmony ID)
|
Creates a patch
public Patch(MethodInfo patch, int index, string owner, int priority, string[] before, string[] after, bool debug)
| Type | Name | Description |
|---|---|---|
| System.Reflection.MethodInfo | patch |
The method of the patch
| | System.Int32 | index |
Zero-based index
| | System.String | owner |
An owner (Harmony ID)
| | System.Int32 | priority |
The priority, see Priority
| | System.String[] | before |
A list of Harmony IDs for patches that should run after this patch
| | System.String[] | after |
A list of Harmony IDs for patches that should run before this patch
| | System.Boolean | debug |
A flag that will log the replacement method via FileLog every time this patch is used to build the replacement, even in the future
|
Keep this patch after the patches indicated in the list of Harmony IDs
public readonly string[] after
| Type | Description |
|---|---|
| System.String[] |
Keep this patch before the patches indicated in the list of Harmony IDs
public readonly string[] before
| Type | Description |
|---|---|
| System.String[] |
A flag that will log the replacement method via FileLog every time this patch is used to build the replacement, even in the future
public readonly bool debug
| Type | Description |
|---|---|
| System.Boolean |
Zero-based index
public readonly int index
| Type | Description |
|---|---|
| System.Int32 |
For an infix patch, this defines the inner method that we will apply the patch to
public readonly InnerMethod innerMethod
| Type | Description |
|---|---|
| InnerMethod |
The owner (Harmony ID)
public readonly string owner
| Type | Description |
|---|---|
| System.String |
The priority, see Priority
public readonly int priority
| Type | Description |
|---|---|
| System.Int32 |
The method of the static patch method
public MethodInfo PatchMethod { get; set; }
| Type | Description |
|---|---|
| System.Reflection.MethodInfo |
Determines how patches sort
public int CompareTo(object obj)
| Type | Name | Description |
|---|---|---|
| System.Object | obj |
The other patch
|
| Type | Description |
|---|---|
| System.Int32 |
integer to define sort order (-1, 0, 1)
|
Determines whether patches are equal
public override bool Equals(object obj)
| Type | Name | Description |
|---|---|---|
| System.Object | obj |
The other patch
|
| Type | Description |
|---|---|
| System.Boolean |
true if equal
|
System.Object.Equals(System.Object)
Hash function
public override int GetHashCode()
| Type | Description |
|---|---|
| System.Int32 |
A hash code
|
System.Object.GetHashCode()
Get the patch method or a DynamicMethod if original patch method is a patch factory
public MethodInfo GetMethod(MethodBase original)
| Type | Name | Description |
|---|---|---|
| System.Reflection.MethodBase | original |
The original method/constructor
|
| Type | Description |
|---|---|
| System.Reflection.MethodInfo |
The method of the patch
|