internal static void Setup(HarmonyInstance harmony, ISpecialModEvents events) { harmony.Patch( original: AccessTools.Method(typeof(GameLocation), "draw"), postfix: new HarmonyMethod(typeof(GameLocationDrawPatch), nameof(GameLocationDrawPatch.Postfix)) ); GameLocationDrawPatch.events = events as SpecialModEvents; }
/// <summary> /// Creates instance of location draw game patch /// </summary> /// <param name="events"></param> /// <exception cref="InvalidOperationException"></exception> /// <exception cref="ArgumentNullException"></exception> public GameLocationDrawPatch(SpecialModEvents events) { this.Events = events ?? throw new ArgumentNullException(nameof(events)); Instance = this; }
/// <summary> /// Creates instance of mailbox game patch /// </summary> /// <param name="events"></param> /// <exception cref="InvalidOperationException"></exception> /// <exception cref="ArgumentNullException"></exception> public MailBoxPatch(SpecialModEvents events) { this.Events = events ?? throw new ArgumentNullException(nameof(events)); Instance = this; }