summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Events/Location.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI/Events/Location.cs')
-rw-r--r--src/StardewModdingAPI/Events/Location.cs30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/StardewModdingAPI/Events/Location.cs b/src/StardewModdingAPI/Events/Location.cs
new file mode 100644
index 00000000..f951ab95
--- /dev/null
+++ b/src/StardewModdingAPI/Events/Location.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using Microsoft.Xna.Framework;
+using StardewValley;
+using Object = StardewValley.Object;
+
+namespace StardewModdingAPI.Events
+{
+ public static class LocationEvents
+ {
+ public static event EventHandler<EventArgsGameLocationsChanged> LocationsChanged = delegate { };
+ public static event EventHandler<EventArgsLocationObjectsChanged> LocationObjectsChanged = delegate { };
+ public static event EventHandler<EventArgsCurrentLocationChanged> CurrentLocationChanged = delegate { };
+
+ internal static void InvokeLocationsChanged(List<GameLocation> newLocations)
+ {
+ LocationsChanged.Invoke(null, new EventArgsGameLocationsChanged(newLocations));
+ }
+
+ internal static void InvokeCurrentLocationChanged(GameLocation priorLocation, GameLocation newLocation)
+ {
+ CurrentLocationChanged.Invoke(null, new EventArgsCurrentLocationChanged(priorLocation, newLocation));
+ }
+
+ internal static void InvokeOnNewLocationObject(SerializableDictionary<Vector2, Object> newObjects)
+ {
+ LocationObjectsChanged.Invoke(null, new EventArgsLocationObjectsChanged(newObjects));
+ }
+ }
+} \ No newline at end of file