summaryrefslogtreecommitdiff
path: root/src/SMAPI/Framework/StateTracking/Snapshots
diff options
context:
space:
mode:
authorJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-06 18:24:59 -0400
committerJesse Plamondon-Willard <Pathoschild@users.noreply.github.com>2022-04-06 18:24:59 -0400
commita593eda30f82af474887d91458b0e9158f66fefc (patch)
tree8aa0e0586e3cce7627e8c4ff445a953665953f8f /src/SMAPI/Framework/StateTracking/Snapshots
parent29f909a8d5dbb83d6df1a54d2680e6f9898f3b19 (diff)
downloadSMAPI-a593eda30f82af474887d91458b0e9158f66fefc.tar.gz
SMAPI-a593eda30f82af474887d91458b0e9158f66fefc.tar.bz2
SMAPI-a593eda30f82af474887d91458b0e9158f66fefc.zip
use target-typed new
Diffstat (limited to 'src/SMAPI/Framework/StateTracking/Snapshots')
-rw-r--r--src/SMAPI/Framework/StateTracking/Snapshots/LocationSnapshot.cs14
-rw-r--r--src/SMAPI/Framework/StateTracking/Snapshots/PlayerSnapshot.cs4
-rw-r--r--src/SMAPI/Framework/StateTracking/Snapshots/WatcherSnapshot.cs16
-rw-r--r--src/SMAPI/Framework/StateTracking/Snapshots/WorldLocationsSnapshot.cs4
4 files changed, 19 insertions, 19 deletions
diff --git a/src/SMAPI/Framework/StateTracking/Snapshots/LocationSnapshot.cs b/src/SMAPI/Framework/StateTracking/Snapshots/LocationSnapshot.cs
index 6c9cc4f5..2563d10c 100644
--- a/src/SMAPI/Framework/StateTracking/Snapshots/LocationSnapshot.cs
+++ b/src/SMAPI/Framework/StateTracking/Snapshots/LocationSnapshot.cs
@@ -17,25 +17,25 @@ namespace StardewModdingAPI.Framework.StateTracking.Snapshots
public GameLocation Location { get; }
/// <summary>Tracks added or removed buildings.</summary>
- public SnapshotListDiff<Building> Buildings { get; } = new SnapshotListDiff<Building>();
+ public SnapshotListDiff<Building> Buildings { get; } = new();
/// <summary>Tracks added or removed debris.</summary>
- public SnapshotListDiff<Debris> Debris { get; } = new SnapshotListDiff<Debris>();
+ public SnapshotListDiff<Debris> Debris { get; } = new();
/// <summary>Tracks added or removed large terrain features.</summary>
- public SnapshotListDiff<LargeTerrainFeature> LargeTerrainFeatures { get; } = new SnapshotListDiff<LargeTerrainFeature>();
+ public SnapshotListDiff<LargeTerrainFeature> LargeTerrainFeatures { get; } = new();
/// <summary>Tracks added or removed NPCs.</summary>
- public SnapshotListDiff<NPC> Npcs { get; } = new SnapshotListDiff<NPC>();
+ public SnapshotListDiff<NPC> Npcs { get; } = new();
/// <summary>Tracks added or removed objects.</summary>
- public SnapshotListDiff<KeyValuePair<Vector2, Object>> Objects { get; } = new SnapshotListDiff<KeyValuePair<Vector2, Object>>();
+ public SnapshotListDiff<KeyValuePair<Vector2, Object>> Objects { get; } = new();
/// <summary>Tracks added or removed terrain features.</summary>
- public SnapshotListDiff<KeyValuePair<Vector2, TerrainFeature>> TerrainFeatures { get; } = new SnapshotListDiff<KeyValuePair<Vector2, TerrainFeature>>();
+ public SnapshotListDiff<KeyValuePair<Vector2, TerrainFeature>> TerrainFeatures { get; } = new();
/// <summary>Tracks added or removed furniture.</summary>
- public SnapshotListDiff<Furniture> Furniture { get; } = new SnapshotListDiff<Furniture>();
+ public SnapshotListDiff<Furniture> Furniture { get; } = new();
/// <summary>Tracks changed chest inventories.</summary>
public IDictionary<Chest, SnapshotItemListDiff> ChestItems { get; } = new Dictionary<Chest, SnapshotItemListDiff>();
diff --git a/src/SMAPI/Framework/StateTracking/Snapshots/PlayerSnapshot.cs b/src/SMAPI/Framework/StateTracking/Snapshots/PlayerSnapshot.cs
index 72f45a87..f3e42948 100644
--- a/src/SMAPI/Framework/StateTracking/Snapshots/PlayerSnapshot.cs
+++ b/src/SMAPI/Framework/StateTracking/Snapshots/PlayerSnapshot.cs
@@ -14,7 +14,7 @@ namespace StardewModdingAPI.Framework.StateTracking.Snapshots
** Fields
*********/
/// <summary>An empty item list diff.</summary>
- private readonly SnapshotItemListDiff EmptyItemListDiff = new SnapshotItemListDiff(Array.Empty<Item>(), Array.Empty<Item>(), Array.Empty<ItemStackSizeChange>());
+ private readonly SnapshotItemListDiff EmptyItemListDiff = new(Array.Empty<Item>(), Array.Empty<Item>(), Array.Empty<ItemStackSizeChange>());
/*********
@@ -24,7 +24,7 @@ namespace StardewModdingAPI.Framework.StateTracking.Snapshots
public Farmer Player { get; }
/// <summary>The player's current location.</summary>
- public SnapshotDiff<GameLocation> Location { get; } = new SnapshotDiff<GameLocation>();
+ public SnapshotDiff<GameLocation> Location { get; } = new();
/// <summary>Tracks changes to the player's skill levels.</summary>
public IDictionary<SkillType, SnapshotDiff<int>> Skills { get; } =
diff --git a/src/SMAPI/Framework/StateTracking/Snapshots/WatcherSnapshot.cs b/src/SMAPI/Framework/StateTracking/Snapshots/WatcherSnapshot.cs
index cf51e040..afea7fb4 100644
--- a/src/SMAPI/Framework/StateTracking/Snapshots/WatcherSnapshot.cs
+++ b/src/SMAPI/Framework/StateTracking/Snapshots/WatcherSnapshot.cs
@@ -11,31 +11,31 @@ namespace StardewModdingAPI.Framework.StateTracking.Snapshots
** Accessors
*********/
/// <summary>Tracks changes to the window size.</summary>
- public SnapshotDiff<Point> WindowSize { get; } = new SnapshotDiff<Point>();
+ public SnapshotDiff<Point> WindowSize { get; } = new();
/// <summary>Tracks changes to the current player.</summary>
public PlayerSnapshot CurrentPlayer { get; private set; }
/// <summary>Tracks changes to the time of day (in 24-hour military format).</summary>
- public SnapshotDiff<int> Time { get; } = new SnapshotDiff<int>();
+ public SnapshotDiff<int> Time { get; } = new();
/// <summary>Tracks changes to the save ID.</summary>
- public SnapshotDiff<ulong> SaveID { get; } = new SnapshotDiff<ulong>();
+ public SnapshotDiff<ulong> SaveID { get; } = new();
/// <summary>Tracks changes to the game's locations.</summary>
- public WorldLocationsSnapshot Locations { get; } = new WorldLocationsSnapshot();
+ public WorldLocationsSnapshot Locations { get; } = new();
/// <summary>Tracks changes to <see cref="Game1.activeClickableMenu"/>.</summary>
- public SnapshotDiff<IClickableMenu> ActiveMenu { get; } = new SnapshotDiff<IClickableMenu>();
+ public SnapshotDiff<IClickableMenu> ActiveMenu { get; } = new();
/// <summary>Tracks changes to the cursor position.</summary>
- public SnapshotDiff<ICursorPosition> Cursor { get; } = new SnapshotDiff<ICursorPosition>();
+ public SnapshotDiff<ICursorPosition> Cursor { get; } = new();
/// <summary>Tracks changes to the mouse wheel scroll.</summary>
- public SnapshotDiff<int> MouseWheelScroll { get; } = new SnapshotDiff<int>();
+ public SnapshotDiff<int> MouseWheelScroll { get; } = new();
/// <summary>Tracks changes to the content locale.</summary>
- public SnapshotDiff<LocalizedContentManager.LanguageCode> Locale { get; } = new SnapshotDiff<LocalizedContentManager.LanguageCode>();
+ public SnapshotDiff<LocalizedContentManager.LanguageCode> Locale { get; } = new();
/*********
diff --git a/src/SMAPI/Framework/StateTracking/Snapshots/WorldLocationsSnapshot.cs b/src/SMAPI/Framework/StateTracking/Snapshots/WorldLocationsSnapshot.cs
index 73ed2d8f..7dee09ca 100644
--- a/src/SMAPI/Framework/StateTracking/Snapshots/WorldLocationsSnapshot.cs
+++ b/src/SMAPI/Framework/StateTracking/Snapshots/WorldLocationsSnapshot.cs
@@ -12,14 +12,14 @@ namespace StardewModdingAPI.Framework.StateTracking.Snapshots
** Fields
*********/
/// <summary>A map of tracked locations.</summary>
- private readonly Dictionary<GameLocation, LocationSnapshot> LocationsDict = new Dictionary<GameLocation, LocationSnapshot>(new ObjectReferenceComparer<GameLocation>());
+ private readonly Dictionary<GameLocation, LocationSnapshot> LocationsDict = new(new ObjectReferenceComparer<GameLocation>());
/*********
** Accessors
*********/
/// <summary>Tracks changes to the location list.</summary>
- public SnapshotListDiff<GameLocation> LocationList { get; } = new SnapshotListDiff<GameLocation>();
+ public SnapshotListDiff<GameLocation> LocationList { get; } = new();
/// <summary>The tracked locations.</summary>
public IEnumerable<LocationSnapshot> Locations => this.LocationsDict.Values;