#if !SMAPI_3_0_STRICT using System; using StardewModdingAPI.Framework; using StardewModdingAPI.Framework.Events; namespace StardewModdingAPI.Events { /// Events raised when the in-game date or time changes. [Obsolete("Use " + nameof(Mod.Helper) + "." + nameof(IModHelper.Events) + " instead. See https://smapi.io/3.0 for more info.")] public static class TimeEvents { /********* ** Properties *********/ /// The core event manager. private static EventManager EventManager; /********* ** Events *********/ /// Raised after the game begins a new day, including when loading a save. public static event EventHandler AfterDayStarted { add { SCore.DeprecationManager.WarnForOldEvents(); TimeEvents.EventManager.Legacy_AfterDayStarted.Add(value); } remove => TimeEvents.EventManager.Legacy_AfterDayStarted.Remove(value); } /// Raised after the in-game clock changes. public static event EventHandler TimeOfDayChanged { add { SCore.DeprecationManager.WarnForOldEvents(); TimeEvents.EventManager.Legacy_TimeOfDayChanged.Add(value); } remove => TimeEvents.EventManager.Legacy_TimeOfDayChanged.Remove(value); } /********* ** Public methods *********/ /// Initialise the events. /// The core event manager. internal static void Init(EventManager eventManager) { TimeEvents.EventManager = eventManager; } } } #endif