summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2018-12-04 23:16:13 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2018-12-04 23:49:09 -0500
commitdad67e213e68eb85c534d7c1c4035dfde90ff822 (patch)
treec041f2e3ae3e3d648709c0c57e2e91fc3967b708 /src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs
parente8ae2d627d59f9cd28d797d2178b7acdead5ace1 (diff)
downloadSMAPI-dad67e213e68eb85c534d7c1c4035dfde90ff822.tar.gz
SMAPI-dad67e213e68eb85c534d7c1c4035dfde90ff822.tar.bz2
SMAPI-dad67e213e68eb85c534d7c1c4035dfde90ff822.zip
fix world events in the mines (#603)
Diffstat (limited to 'src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs')
-rw-r--r--src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs b/src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs
index ab4ab0d5..8301351e 100644
--- a/src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs
+++ b/src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs
@@ -36,6 +36,14 @@ namespace StardewModdingAPI.Framework.StateTracking.FieldWatchers
return new ComparableWatcher<T>(getValue, new ObjectReferenceComparer<T>());
}
+ /// <summary>Get a watcher which detects when an object reference in a collection changes.</summary>
+ /// <typeparam name="T">The value type.</typeparam>
+ /// <param name="collection">The observable collection.</param>
+ public static ComparableListWatcher<T> ForReferenceList<T>(ICollection<T> collection)
+ {
+ return new ComparableListWatcher<T>(collection, new ObjectReferenceComparer<T>());
+ }
+
/// <summary>Get a watcher for an observable collection.</summary>
/// <typeparam name="T">The value type.</typeparam>
/// <param name="collection">The observable collection.</param>