summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2018-11-19 13:48:19 -0500
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2018-11-19 13:48:19 -0500
commit593723b7940ba72a786fc4c7366c56f9813d977b (patch)
tree4d23fbef5bc5a20115f10ca04ae3379df78cc8e1 /src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs
parent4f28ea33bd7cc65485402c5e85259083e86b49e1 (diff)
parent3dc27a5681dcfc4ae30e95570d9966f2e14a4dd7 (diff)
downloadSMAPI-593723b7940ba72a786fc4c7366c56f9813d977b.tar.gz
SMAPI-593723b7940ba72a786fc4c7366c56f9813d977b.tar.bz2
SMAPI-593723b7940ba72a786fc4c7366c56f9813d977b.zip
Merge branch 'develop' into stable
Diffstat (limited to 'src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs')
-rw-r--r--src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs b/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs
index d9090c08..5a259663 100644
--- a/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs
+++ b/src/SMAPI/Framework/StateTracking/WorldLocationsTracker.cs
@@ -1,6 +1,8 @@
+using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
+using StardewModdingAPI.Framework.StateTracking.Comparers;
using StardewModdingAPI.Framework.StateTracking.FieldWatchers;
using StardewValley;
using StardewValley.Buildings;
@@ -18,10 +20,10 @@ namespace StardewModdingAPI.Framework.StateTracking
private readonly ICollectionWatcher<GameLocation> LocationListWatcher;
/// <summary>A lookup of the tracked locations.</summary>
- private IDictionary<GameLocation, LocationTracker> LocationDict { get; } = new Dictionary<GameLocation, LocationTracker>();
+ private IDictionary<GameLocation, LocationTracker> LocationDict { get; } = new Dictionary<GameLocation, LocationTracker>(new ObjectReferenceComparer<GameLocation>());
/// <summary>A lookup of registered buildings and their indoor location.</summary>
- private readonly IDictionary<Building, GameLocation> BuildingIndoors = new Dictionary<Building, GameLocation>();
+ private readonly IDictionary<Building, GameLocation> BuildingIndoors = new Dictionary<Building, GameLocation>(new ObjectReferenceComparer<Building>());
/*********
@@ -37,10 +39,10 @@ namespace StardewModdingAPI.Framework.StateTracking
public IEnumerable<LocationTracker> Locations => this.LocationDict.Values;
/// <summary>The locations removed since the last update.</summary>
- public ICollection<GameLocation> Added { get; } = new HashSet<GameLocation>();
+ public ICollection<GameLocation> Added { get; } = new HashSet<GameLocation>(new ObjectReferenceComparer<GameLocation>());
/// <summary>The locations added since the last update.</summary>
- public ICollection<GameLocation> Removed { get; } = new HashSet<GameLocation>();
+ public ICollection<GameLocation> Removed { get; } = new HashSet<GameLocation>(new ObjectReferenceComparer<GameLocation>());
/*********