diff options
Diffstat (limited to 'src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs')
-rw-r--r-- | src/SMAPI/Framework/StateTracking/FieldWatchers/NetDictionaryWatcher.cs | 19 |
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) |