Class ConfiguredMonkey<TMonkey, TConfigSection>
- Namespace
- MonkeyLoader.Patching
- Assembly
- MonkeyLoader.dll
Represents a base class for patchers that run after a game's assemblies have been loaded,
while using a .TConfigSection ConfigSection
All mod defined derivatives must derive from Monkey<TMonkey>,
ConfiguredMonkey<TMonkey, TConfigSection>, or another class derived from it.
public abstract class ConfiguredMonkey<TMonkey, TConfigSection> : Monkey<TMonkey>, IConfiguredMonkey<TConfigSection>, IConfiguredMonkey, IMonkey, IRun, IShutdown, IComparable<IMonkey>, INestedIdentifiable<Mod>, INestedIdentifiable, IIdentifiable, IAuthorable, IDisplayable where TMonkey : ConfiguredMonkey<TMonkey, TConfigSection>, new() where TConfigSection : ConfigSection, new()
Type Parameters
TMonkeyThe type of the actual patcher.
TConfigSectionThe type of the config section to load.
- Inheritance
-
MonkeyBase<TMonkey>Monkey<TMonkey>ConfiguredMonkey<TMonkey, TConfigSection>
- Implements
-
IConfiguredMonkey<TConfigSection>
- Inherited Members
- Extension Methods
Remarks
Game assemblies and their types can be directly referenced from these.
Constructors
ConfiguredMonkey()
Allows creating only a single TMonkey instance.
protected ConfiguredMonkey()
Properties
ConfigSection
Gets the loaded config section for this patcher after it has been run.
public static TConfigSection ConfigSection { get; }
Property Value
- TConfigSection
Methods
OnLoaded()
Called right after the game tooling packs and all the game's assemblies have been loaded.
Use this to apply any patching and return true if it was successful.
protected override bool OnLoaded()
Returns
- bool
trueif it ran successfully; otherwise,false.
Remarks
By default: Loads this patcher's .TConfigSection ConfigSection
Then applies the HarmonyLib.Harmony patches of the
category with this patcher's type's name.
Easy to apply by using [HarmonyLib.HarmonyPatchCategory(nameof(MyPatcher))] attribute.