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 the player warps to a new location. public static event EventHandler CurrentLocationChanged { add => LocationEvents.EventManager.Location_CurrentLocationChanged.Add(value); remove => LocationEvents.EventManager.Location_CurrentLocationChanged.Remove(value); } /// Raised after a game location is added or removed. public static event EventHandler LocationsChanged { add => LocationEvents.EventManager.Location_LocationsChanged.Add(value); remove => LocationEvents.EventManager.Location_LocationsChanged.Remove(value); } /// Raised after the list of objects in the current location changes (e.g. an object is added or removed). public static event EventHandler LocationObjectsChanged { add => LocationEvents.EventManager.Location_LocationObjectsChanged.Add(value); remove => LocationEvents.EventManager.Location_LocationObjectsChanged.Remove(value); } /********* ** Public methods *********/ /// Initialise the events. /// The core event manager. internal static void Init(EventManager eventManager) { LocationEvents.EventManager = eventManager; } } }