Class FeaturePatch<TFeature>
- Namespace
- MonkeyLoader.Patching
- Assembly
- MonkeyLoader.dll
Specifies how much a (pre-)patcher affects a particular Feature.
public sealed class FeaturePatch<TFeature> : IFeaturePatch, IEquatable<IFeaturePatch>, IComparable<IFeaturePatch> where TFeature : Feature, new()
Type Parameters
TFeatureThe patched game feature.
- Inheritance
-
FeaturePatch<TFeature>
- Implements
- Inherited Members
Constructors
FeaturePatch(PatchCompatibility)
Creates a new feature patch with the given PatchCompatibility.
public FeaturePatch(PatchCompatibility patchCompatibility)
Parameters
patchCompatibilityPatchCompatibilityHow compatible the patch is with others.
Properties
Compatibility
Gets how compatible the patch is with others.
public PatchCompatibility Compatibility { get; }
Property Value
Feature
Gets the affected feature.
public TFeature Feature { get; }
Property Value
- TFeature
Methods
CompareTo(IFeaturePatch?)
Compares the impact of this patch to another. Uses AscendingComparer: higher impact first.
public int CompareTo(IFeaturePatch? other)
Parameters
otherIFeaturePatchAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes
otherin the sort order. Zero This instance occurs in the same position in the sort order asother. Greater than zero This instance followsotherin the sort order.
Equals(IFeaturePatch?)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(IFeaturePatch? other)
Parameters
otherIFeaturePatchAn object to compare with this object.
Returns
- bool
true if the current object is equal to the
otherparameter; otherwise, false.
Equals(object?)
Determines whether the specified object is equal to the current object.
public override bool Equals(object? obj)
Parameters
objobjectThe object to compare with the current object.
Returns
- bool
true if the specified object is equal to the current object; otherwise, false.
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.