diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-27 18:09:04 -0400 |
---|---|---|
committer | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2022-05-27 18:09:04 -0400 |
commit | 0209e70695b6d12692d4de554ce1fc9d65ca4715 (patch) | |
tree | 011867d845ee3cf2a88f306504a4bdd6fe414ed6 /src/SMAPI/Framework/StateTracking/FieldWatchers/NetCollectionWatcher.cs | |
parent | 2ab2182645179129997eac3fccb63f6f0683dbe1 (diff) | |
parent | e4cd7c8eb09fa50802ce4eb9dbe4683ce61f7a5d (diff) | |
download | SMAPI-0209e70695b6d12692d4de554ce1fc9d65ca4715.tar.gz SMAPI-0209e70695b6d12692d4de554ce1fc9d65ca4715.tar.bz2 SMAPI-0209e70695b6d12692d4de554ce1fc9d65ca4715.zip |
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/StateTracking/FieldWatchers/NetCollectionWatcher.cs')
-rw-r--r-- | src/SMAPI/Framework/StateTracking/FieldWatchers/NetCollectionWatcher.cs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/SMAPI/Framework/StateTracking/FieldWatchers/NetCollectionWatcher.cs b/src/SMAPI/Framework/StateTracking/FieldWatchers/NetCollectionWatcher.cs index 676c9fb4..1d5e4851 100644 --- a/src/SMAPI/Framework/StateTracking/FieldWatchers/NetCollectionWatcher.cs +++ b/src/SMAPI/Framework/StateTracking/FieldWatchers/NetCollectionWatcher.cs @@ -24,13 +24,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.AddedImpl.Count > 0 || this.RemovedImpl.Count > 0; - /// <summary>The values added since the last reset.</summary> + /// <inheritdoc /> public IEnumerable<TValue> Added => this.AddedImpl; - /// <summary>The values removed since the last reset.</summary> + /// <inheritdoc /> public IEnumerable<TValue> Removed => this.RemovedImpl; @@ -38,21 +41,23 @@ 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 NetCollectionWatcher(NetCollection<TValue> field) + public NetCollectionWatcher(string name, NetCollection<TValue> 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(); @@ -61,7 +66,7 @@ namespace StardewModdingAPI.Framework.StateTracking.FieldWatchers this.RemovedImpl.Clear(); } - /// <summary>Stop watching the field and release all references.</summary> + /// <inheritdoc /> public override void Dispose() { if (!this.IsDisposed) |