using System; using StardewValley; namespace StardewModdingAPI.Framework { /// Invokes callbacks for mod hooks provided by the game. internal class SModHooks : ModHooks { /********* ** Properties *********/ /// A callback to invoke before runs. private readonly Action BeforeNewDayAfterFade; /********* ** Public methods *********/ /// Construct an instance. /// A callback to invoke before runs. public SModHooks(Action beforeNewDayAfterFade) { this.BeforeNewDayAfterFade = beforeNewDayAfterFade; } /// A hook invoked when is called. /// The vanilla logic. public override void OnGame1_NewDayAfterFade(Action action) { this.BeforeNewDayAfterFade?.Invoke(); action(); } } }