summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/StateTracking/FieldWatchers/ObservableCollectionWatcher.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/SMAPI/Framework/StateTracking/FieldWatchers/ObservableCollectionWatcher.cs')
-rw-r--r--src/SMAPI/Framework/StateTracking/FieldWatchers/ObservableCollectionWatcher.cs19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/SMAPI/Framework/StateTracking/FieldWatchers/ObservableCollectionWatcher.cs b/src/SMAPI/Framework/StateTracking/FieldWatchers/ObservableCollectionWatcher.cs
index 97aedca8..1f95ac89 100644
--- a/src/SMAPI/Framework/StateTracking/FieldWatchers/ObservableCollectionWatcher.cs
+++ b/src/SMAPI/Framework/StateTracking/FieldWatchers/ObservableCollectionWatcher.cs
@@ -28,13 +28,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;
@@ -42,20 +45,22 @@ 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 ObservableCollectionWatcher(ObservableCollection<TValue> field)
+ public ObservableCollectionWatcher(string name, ObservableCollection<TValue> field)
{
+ this.Name = name;
this.Field = field;
field.CollectionChanged += this.OnCollectionChanged;
}
- /// <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();
@@ -64,7 +69,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)