using System;
using StardewModdingAPI.Framework.Events;
namespace StardewModdingAPI.Events
{
/// Events raised when the player transitions between game locations, a location is added or removed, or the objects in the current location change.
public static class LocationEvents
{
/*********
** Properties
*********/
/// The core event manager.
private static EventManager EventManager;
/*********
** Events
*********/
/// Raised after a game location is added or removed.
public static event EventHandler LocationsChanged
{
add => LocationEvents.EventManager.Legacy_Location_LocationsChanged.Add(value);
remove => LocationEvents.EventManager.Legacy_Location_LocationsChanged.Remove(value);
}
/// Raised after buildings are added or removed in a location.
public static event EventHandler BuildingsChanged
{
add => LocationEvents.EventManager.Legacy_Location_BuildingsChanged.Add(value);
remove => LocationEvents.EventManager.Legacy_Location_BuildingsChanged.Remove(value);
}
/// Raised after objects are added or removed in a location.
public static event EventHandler ObjectsChanged
{
add => LocationEvents.EventManager.Legacy_Location_ObjectsChanged.Add(value);
remove => LocationEvents.EventManager.Legacy_Location_ObjectsChanged.Remove(value);
}
/*********
** Public methods
*********/
/// Initialise the events.
/// The core event manager.
internal static void Init(EventManager eventManager)
{
LocationEvents.EventManager = eventManager;
}
}
}