using System; using System.Collections.Generic; using System.IO; using BepInEx.Bootstrap; namespace BepInEx.Preloader.Core { /// /// A single assembly patcher. /// public class PatcherPlugin : ICacheable { /// /// Target assemblies to patch. /// public Func> TargetDLLs { get; set; } = null; /// /// Initializer method that is run before any patching occurs. /// public Action Initializer { get; set; } = null; /// /// Finalizer method that is run after all patching is done. /// public Action Finalizer { get; set; } = null; /// /// The main patcher method that is called on every DLL defined in . /// public AssemblyPatcherDelegate Patcher { get; set; } = null; /// /// Type name of the patcher. /// public string TypeName { get; set; } = string.Empty; /// public void Save(BinaryWriter bw) { bw.Write(TypeName); } /// public void Load(BinaryReader br) { TypeName = br.ReadString(); } } }