summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-27 18:09:04 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-05-27 18:09:04 -0400
commit0209e70695b6d12692d4de554ce1fc9d65ca4715 (patch)
tree011867d845ee3cf2a88f306504a4bdd6fe414ed6 /src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs
parent2ab2182645179129997eac3fccb63f6f0683dbe1 (diff)
parente4cd7c8eb09fa50802ce4eb9dbe4683ce61f7a5d (diff)
downloadSMAPI-0209e70695b6d12692d4de554ce1fc9d65ca4715.tar.gz
SMAPI-0209e70695b6d12692d4de554ce1fc9d65ca4715.tar.bz2
SMAPI-0209e70695b6d12692d4de554ce1fc9d65ca4715.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs')
-rw-r--r--src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs b/src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs
index f55e4cea..3bd8e09d 100644
--- a/src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs
+++ b/src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs
@@ -31,13 +31,16 @@ namespace StardewModdingAPI.Framework.StateTracking.FieldWatchers
/*********
** Accessors
*********/
- /// <summary>Whether the collection changed since the last reset.</summary>
+ /// <inheritdoc />
+ public string Name { get; }
+
+ /// <inheritdoc />
public bool IsChanged => this.PairsAdded.Count > 0 || this.PairsRemoved.Count > 0;
- /// <summary>The values added since the last reset.</summary>
+ /// <inheritdoc />
public IEnumerable<KeyValuePair<TKey, TValue>> Added => this.PairsAdded;
- /// <summary>The values removed since the last reset.</summary>
+ /// <inheritdoc />
public IEnumerable<KeyValuePair<TKey, TValue>> Removed => this.PairsRemoved;
@@ -45,22 +48,24 @@ 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;
field.OnValueRemoved += this.OnValueRemoved;
}
- /// <summary>Update the current value if needed.</summary>
+ /// <inheritdoc />
public void Update()
{
this.AssertNotDisposed();
}
- /// <summary>Set the current value as the baseline.</summary>
+ /// <inheritdoc />
public void Reset()
{
this.AssertNotDisposed();
@@ -69,7 +74,7 @@ namespace StardewModdingAPI.Framework.StateTracking.FieldWatchers
this.PairsRemoved.Clear();
}
- /// <summary>Stop watching the field and release all references.</summary>
+ /// <inheritdoc />
public override void Dispose()
{
if (!this.IsDisposed)