#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;
/// Manages deprecation warnings.
private static DeprecationManager DeprecationManager;
/*********
** Events
*********/
/// Raised after the game begins a new day, including when loading a save.
public static event EventHandler AfterDayStarted
{
add
{
TimeEvents.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
{
TimeEvents.DeprecationManager.WarnForOldEvents();
TimeEvents.EventManager.Legacy_TimeOfDayChanged.Add(value);
}
remove => TimeEvents.EventManager.Legacy_TimeOfDayChanged.Remove(value);
}
/*********
** Public methods
*********/
/// Initialise the events.
/// The core event manager.
/// Manages deprecation warnings.
internal static void Init(EventManager eventManager, DeprecationManager deprecationManager)
{
TimeEvents.EventManager = eventManager;
TimeEvents.DeprecationManager = deprecationManager;
}
}
}
#endif