using System; namespace StardewModdingAPI.Events { public static class TimeEvents { public static event EventHandler TimeOfDayChanged = delegate { }; public static event EventHandler DayOfMonthChanged = delegate { }; public static event EventHandler YearOfGameChanged = delegate { }; public static event EventHandler SeasonOfYearChanged = delegate { }; /// /// Occurs when Game1.newDay changes. True directly before saving, and False directly after. /// public static event EventHandler OnNewDay = delegate { }; internal static void InvokeTimeOfDayChanged(int priorInt, int newInt) { TimeOfDayChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt)); } internal static void InvokeDayOfMonthChanged(int priorInt, int newInt) { DayOfMonthChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt)); } internal static void InvokeYearOfGameChanged(int priorInt, int newInt) { YearOfGameChanged.Invoke(null, new EventArgsIntChanged(priorInt, newInt)); } internal static void InvokeSeasonOfYearChanged(string priorString, string newString) { SeasonOfYearChanged.Invoke(null, new EventArgsStringChanged(priorString, newString)); } internal static void InvokeOnNewDay(int priorInt, int newInt, bool newDay) { OnNewDay.Invoke(null, new EventArgsNewDay(priorInt, newInt, newDay)); } } }