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;
        }
Esempio n. 2
0
 /// <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;
 }
Esempio n. 3
0
 /// <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;
 }