summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-01-01 00:13:59 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2020-01-01 00:13:59 -0500
commit844efa32d49baa2ca58332cd26bbbe3cc772ad22 (patch)
treedfb74e5da8140a86b867ccf1b4210320c2edba0a /src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs
parent6bf99f0f81582ab6d6212dc21e8c36686ceb5a35 (diff)
downloadSMAPI-844efa32d49baa2ca58332cd26bbbe3cc772ad22.tar.gz
SMAPI-844efa32d49baa2ca58332cd26bbbe3cc772ad22.tar.bz2
SMAPI-844efa32d49baa2ca58332cd26bbbe3cc772ad22.zip
optimize chest watchers using net events
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 314ff7f5..bde43486 100644
--- a/src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs
+++ b/src/SMAPI/Framework/StateTracking/FieldWatchers/WatcherFactory.cs
@@ -82,6 +82,14 @@ namespace StardewModdingAPI.Framework.StateTracking.FieldWatchers
return new NetCollectionWatcher<T>(collection);
}
+ /// <summary>Get a watcher for a net list.</summary>
+ /// <typeparam name="T">The value type.</typeparam>
+ /// <param name="collection">The net list.</param>
+ public static ICollectionWatcher<T> ForNetList<T>(NetList<T, NetRef<T>> collection) where T : class, INetObject<INetSerializable>
+ {
+ return new NetListWatcher<T>(collection);
+ }
+
/// <summary>Get a watcher for a net dictionary.</summary>
/// <typeparam name="TKey">The dictionary key type.</typeparam>
/// <typeparam name="TValue">The dictionary value type.</typeparam>