summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/StateTracking/FieldWatchers/NetListWatcher.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-23 12:57:33 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-23 12:57:33 -0400
commit5675f9fcebfdeb03510c347712df8e9934b362c6 (patch)
treed026ccce206b73e01bbda75da85ee1d180fc0d27 /src/SMAPI/Framework/StateTracking/FieldWatchers/NetListWatcher.cs
parent87ac7fc4032c1edbc246e7f7a96881f1284c04b9 (diff)
downloadSMAPI-5675f9fcebfdeb03510c347712df8e9934b362c6.tar.gz
SMAPI-5675f9fcebfdeb03510c347712df8e9934b362c6.tar.bz2
SMAPI-5675f9fcebfdeb03510c347712df8e9934b362c6.zip
add watcher names to simplify troubleshooting
Diffstat (limited to 'src/SMAPI/Framework/StateTracking/FieldWatchers/NetListWatcher.cs')
-rw-r--r--src/SMAPI/Framework/StateTracking/FieldWatchers/NetListWatcher.cs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/StateTracking/FieldWatchers/NetListWatcher.cs b/src/SMAPI/Framework/StateTracking/FieldWatchers/NetListWatcher.cs
index 3badb533..5b6a3e1f 100644
--- a/src/SMAPI/Framework/StateTracking/FieldWatchers/NetListWatcher.cs
+++ b/src/SMAPI/Framework/StateTracking/FieldWatchers/NetListWatcher.cs
@@ -26,6 +26,9 @@ namespace StardewModdingAPI.Framework.StateTracking.FieldWatchers
** Accessors
*********/
/// <inheritdoc />
+ public string Name { get; }
+
+ /// <inheritdoc />
public bool IsChanged => this.AddedImpl.Count > 0 || this.RemovedImpl.Count > 0;
/// <inheritdoc />
@@ -39,9 +42,11 @@ namespace StardewModdingAPI.Framework.StateTracking.FieldWatchers
** Public methods
*********/
/// <summary>Construct an instance.</summary>
+ /// <param name="name">A name which identifies what the watcher is watching, used for troubleshooting.</param>
/// <param name="field">The field to watch.</param>
- public NetListWatcher(NetList<TValue, NetRef<TValue>> field)
+ public NetListWatcher(string name, NetList<TValue, NetRef<TValue>> field)
{
+ this.Name = name;
this.Field = field;
field.OnElementChanged += this.OnElementChanged;
field.OnArrayReplaced += this.OnArrayReplaced;