summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/StateTracking/LocationTracker.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/Framework/StateTracking/LocationTracker.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/Framework/StateTracking/LocationTracker.cs')
-rw-r--r--src/SMAPI/Framework/StateTracking/LocationTracker.cs12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/SMAPI/Framework/StateTracking/LocationTracker.cs b/src/SMAPI/Framework/StateTracking/LocationTracker.cs
index 07570401..d31b1128 100644
--- a/src/SMAPI/Framework/StateTracking/LocationTracker.cs
+++ b/src/SMAPI/Framework/StateTracking/LocationTracker.cs
@@ -6,6 +6,7 @@ using StardewModdingAPI.Framework.StateTracking.FieldWatchers;
using StardewValley;
using StardewValley.Buildings;
using StardewValley.Locations;
+using StardewValley.TerrainFeatures;
using Object = StardewValley.Object;
namespace StardewModdingAPI.Framework.StateTracking
@@ -29,12 +30,15 @@ namespace StardewModdingAPI.Framework.StateTracking
/// <summary>The tracked location.</summary>
public GameLocation Location { get; }
- /// <summary>Tracks changes to the location's buildings.</summary>
+ /// <summary>Tracks added or removed buildings.</summary>
public ICollectionWatcher<Building> BuildingsWatcher { get; }
- /// <summary>Tracks changes to the location's objects.</summary>
+ /// <summary>Tracks added or removed objects.</summary>
public IDictionaryWatcher<Vector2, Object> ObjectsWatcher { get; }
+ /// <summary>Tracks added or removed terrain features.</summary>
+ public IDictionaryWatcher<Vector2, TerrainFeature> TerrainFeaturesWatcher { get; }
+
/*********
** Public methods
@@ -50,11 +54,13 @@ namespace StardewModdingAPI.Framework.StateTracking
this.BuildingsWatcher = location is BuildableGameLocation buildableLocation
? WatcherFactory.ForNetCollection(buildableLocation.buildings)
: (ICollectionWatcher<Building>)WatcherFactory.ForObservableCollection(new ObservableCollection<Building>());
+ this.TerrainFeaturesWatcher = WatcherFactory.ForNetDictionary(location.terrainFeatures);
this.Watchers.AddRange(new IWatcher[]
{
this.BuildingsWatcher,
- this.ObjectsWatcher
+ this.ObjectsWatcher,
+ this.TerrainFeaturesWatcher
});
}