summaryrefslogtreecommitdiff
path: root/src/SMAPI/Events/WorldTerrainFeatureListChangedEventArgs.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <github@jplamondonw.com>2018-06-01 01:58:31 -0400
committerJesse Plamondon-Willard <github@jplamondonw.com>2018-06-01 01:58:31 -0400
commitb3f116a8f123387b1f2f9ce1a099d1fd8081708d (patch)
tree4ad91a8c823474786ea92b2a74f2c9f4347c96ba /src/SMAPI/Events/WorldTerrainFeatureListChangedEventArgs.cs
parentcca7bf197079975bf310ca90c03b78d0f77fdf02 (diff)
downloadSMAPI-b3f116a8f123387b1f2f9ce1a099d1fd8081708d.tar.gz
SMAPI-b3f116a8f123387b1f2f9ce1a099d1fd8081708d.tar.bz2
SMAPI-b3f116a8f123387b1f2f9ce1a099d1fd8081708d.zip
add terrain feature list changed event (#310)
Diffstat (limited to 'src/SMAPI/Events/WorldTerrainFeatureListChangedEventArgs.cs')
-rw-r--r--src/SMAPI/Events/WorldTerrainFeatureListChangedEventArgs.cs40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/SMAPI/Events/WorldTerrainFeatureListChangedEventArgs.cs b/src/SMAPI/Events/WorldTerrainFeatureListChangedEventArgs.cs
new file mode 100644
index 00000000..cb089811
--- /dev/null
+++ b/src/SMAPI/Events/WorldTerrainFeatureListChangedEventArgs.cs
@@ -0,0 +1,40 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using Microsoft.Xna.Framework;
+using StardewValley;
+using StardewValley.TerrainFeatures;
+
+namespace StardewModdingAPI.Events
+{
+ /// <summary>Event arguments for a <see cref="IWorldEvents.TerrainFeatureListChanged"/> event.</summary>
+ public class WorldTerrainFeatureListChangedEventArgs : EventArgs
+ {
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The location which changed.</summary>
+ public GameLocation Location { get; }
+
+ /// <summary>The terrain features added to the location.</summary>
+ public IEnumerable<KeyValuePair<Vector2, TerrainFeature>> Added { get; }
+
+ /// <summary>The terrain features removed from the location.</summary>
+ public IEnumerable<KeyValuePair<Vector2, TerrainFeature>> Removed { get; }
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ /// <param name="location">The location which changed.</param>
+ /// <param name="added">The terrain features added to the location.</param>
+ /// <param name="removed">The terrain features removed from the location.</param>
+ public WorldTerrainFeatureListChangedEventArgs(GameLocation location, IEnumerable<KeyValuePair<Vector2, TerrainFeature>> added, IEnumerable<KeyValuePair<Vector2, TerrainFeature>> removed)
+ {
+ this.Location = location;
+ this.Added = added.ToArray();
+ this.Removed = removed.ToArray();
+ }
+ }
+}