diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-23 12:57:33 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-23 12:57:33 -0400 |
commit | 5675f9fcebfdeb03510c347712df8e9934b362c6 (patch) | |
tree | d026ccce206b73e01bbda75da85ee1d180fc0d27 /src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs | |
parent | 87ac7fc4032c1edbc246e7f7a96881f1284c04b9 (diff) | |
download | SMAPI-5675f9fcebfdeb03510c347712df8e9934b362c6.tar.gz SMAPI-5675f9fcebfdeb03510c347712df8e9934b362c6.tar.bz2 SMAPI-5675f9fcebfdeb03510c347712df8e9934b362c6.zip |
add watcher names to simplify troubleshooting
Diffstat (limited to 'src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs')
-rw-r--r-- | src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs b/src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs index a0fcc236..3bd8e09d 100644 --- a/src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs +++ b/src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs @@ -32,6 +32,9 @@ namespace StardewModdingAPI.Framework.StateTracking.FieldWatchers ** Accessors *********/ /// <inheritdoc /> + public string Name { get; } + + /// <inheritdoc /> public bool IsChanged => this.PairsAdded.Count > 0 || this.PairsRemoved.Count > 0; /// <inheritdoc /> @@ -45,9 +48,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 NetDictionaryWatcher(NetDictionary<TKey, TValue, TField, TSerialDict, TSelf> field) + public NetDictionaryWatcher(string name, NetDictionary<TKey, TValue, TField, TSerialDict, TSelf> field) { + this.Name = name; this.Field = field; field.OnValueAdded += this.OnValueAdded; |