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/WorldLocationsTracker.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/WorldLocationsTracker.cs')
-rw-r--r-- | src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs b/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs index 817a6011..ca6988ad 100644 --- a/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs +++ b/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs @@ -34,10 +34,13 @@ namespace StardewModdingAPI.Framework.StateTracking /********* ** Accessors *********/ + /// <inheritdoc /> + public string Name => nameof(WorldLocationsTracker); + /// <summary>Whether locations were added or removed since the last reset.</summary> public bool IsLocationListChanged => this.Added.Any() || this.Removed.Any(); - /// <summary>Whether any tracked location data changed since the last reset.</summary> + /// <inheritdoc /> public bool IsChanged => this.IsLocationListChanged || this.Locations.Any(p => p.IsChanged); /// <summary>The tracked locations.</summary> @@ -59,12 +62,12 @@ namespace StardewModdingAPI.Framework.StateTracking /// <param name="activeVolcanoLocations">The game's list of active volcano locations.</param> public WorldLocationsTracker(ObservableCollection<GameLocation> locations, IList<MineShaft> activeMineLocations, IList<VolcanoDungeon> activeVolcanoLocations) { - this.LocationListWatcher = WatcherFactory.ForObservableCollection(locations); - this.MineLocationListWatcher = WatcherFactory.ForReferenceList(activeMineLocations); - this.VolcanoLocationListWatcher = WatcherFactory.ForReferenceList(activeVolcanoLocations); + this.LocationListWatcher = WatcherFactory.ForObservableCollection($"{this.Name}.{nameof(locations)}", locations); + this.MineLocationListWatcher = WatcherFactory.ForReferenceList($"{this.Name}.{nameof(activeMineLocations)}", activeMineLocations); + this.VolcanoLocationListWatcher = WatcherFactory.ForReferenceList($"{this.Name}.{nameof(activeVolcanoLocations)}", activeVolcanoLocations); } - /// <summary>Update the current value if needed.</summary> + /// <inheritdoc /> public void Update() { // update watchers @@ -120,7 +123,7 @@ namespace StardewModdingAPI.Framework.StateTracking this.VolcanoLocationListWatcher.Reset(); } - /// <summary>Set the current value as the baseline.</summary> + /// <inheritdoc /> public void Reset() { this.ResetLocationList(); @@ -135,7 +138,7 @@ namespace StardewModdingAPI.Framework.StateTracking return this.LocationDict.ContainsKey(location); } - /// <summary>Stop watching the player fields and release all references.</summary> + /// <inheritdoc /> public void Dispose() { foreach (IWatcher watcher in this.GetWatchers()) |