diff options
Diffstat (limited to 'src/SMAPI/Framework/StateTracking/FieldWatchers/NetValueWatcher.cs')
-rw-r--r-- | src/SMAPI/Framework/StateTracking/FieldWatchers/NetValueWatcher.cs | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/SMAPI/Framework/StateTracking/FieldWatchers/NetValueWatcher.cs b/src/SMAPI/Framework/StateTracking/FieldWatchers/NetValueWatcher.cs index 48d5d681..e4219dda 100644 --- a/src/SMAPI/Framework/StateTracking/FieldWatchers/NetValueWatcher.cs +++ b/src/SMAPI/Framework/StateTracking/FieldWatchers/NetValueWatcher.cs @@ -17,13 +17,16 @@ namespace StardewModdingAPI.Framework.StateTracking.FieldWatchers /********* ** Accessors *********/ - /// <summary>Whether the value changed since the last reset.</summary> + /// <inheritdoc /> + public string Name { get; } + + /// <inheritdoc /> public bool IsChanged { get; private set; } - /// <summary>The field value at the last reset.</summary> + /// <inheritdoc /> public TValue PreviousValue { get; private set; } - /// <summary>The latest value.</summary> + /// <inheritdoc /> public TValue CurrentValue { get; private set; } @@ -31,9 +34,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 NetValueWatcher(NetFieldBase<TValue, TNetField> field) + public NetValueWatcher(string name, NetFieldBase<TValue, TNetField> field) { + this.Name = name; this.Field = field; this.PreviousValue = field.Value; this.CurrentValue = field.Value; @@ -42,13 +47,13 @@ namespace StardewModdingAPI.Framework.StateTracking.FieldWatchers field.fieldChangeEvent += this.OnValueChanged; } - /// <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(); @@ -57,7 +62,7 @@ namespace StardewModdingAPI.Framework.StateTracking.FieldWatchers this.IsChanged = false; } - /// <summary>Stop watching the field and release all references.</summary> + /// <inheritdoc /> public override void Dispose() { if (!this.IsDisposed) |