From a593eda30f82af474887d91458b0e9158f66fefc Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Wed, 6 Apr 2022 18:24:59 -0400 Subject: use target-typed new --- .../StateTracking/Snapshots/LocationSnapshot.cs | 14 +++++++------- .../Framework/StateTracking/Snapshots/PlayerSnapshot.cs | 4 ++-- .../Framework/StateTracking/Snapshots/WatcherSnapshot.cs | 16 ++++++++-------- .../StateTracking/Snapshots/WorldLocationsSnapshot.cs | 4 ++-- 4 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src/SMAPI/Framework/StateTracking/Snapshots') 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; } /// Tracks added or removed buildings. - public SnapshotListDiff Buildings { get; } = new SnapshotListDiff(); + public SnapshotListDiff Buildings { get; } = new(); /// Tracks added or removed debris. - public SnapshotListDiff Debris { get; } = new SnapshotListDiff(); + public SnapshotListDiff Debris { get; } = new(); /// Tracks added or removed large terrain features. - public SnapshotListDiff LargeTerrainFeatures { get; } = new SnapshotListDiff(); + public SnapshotListDiff LargeTerrainFeatures { get; } = new(); /// Tracks added or removed NPCs. - public SnapshotListDiff Npcs { get; } = new SnapshotListDiff(); + public SnapshotListDiff Npcs { get; } = new(); /// Tracks added or removed objects. - public SnapshotListDiff> Objects { get; } = new SnapshotListDiff>(); + public SnapshotListDiff> Objects { get; } = new(); /// Tracks added or removed terrain features. - public SnapshotListDiff> TerrainFeatures { get; } = new SnapshotListDiff>(); + public SnapshotListDiff> TerrainFeatures { get; } = new(); /// Tracks added or removed furniture. - public SnapshotListDiff Furniture { get; } = new SnapshotListDiff(); + public SnapshotListDiff Furniture { get; } = new(); /// Tracks changed chest inventories. public IDictionary ChestItems { get; } = new Dictionary(); 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 *********/ /// An empty item list diff. - private readonly SnapshotItemListDiff EmptyItemListDiff = new SnapshotItemListDiff(Array.Empty(), Array.Empty(), Array.Empty()); + private readonly SnapshotItemListDiff EmptyItemListDiff = new(Array.Empty(), Array.Empty(), Array.Empty()); /********* @@ -24,7 +24,7 @@ namespace StardewModdingAPI.Framework.StateTracking.Snapshots public Farmer Player { get; } /// The player's current location. - public SnapshotDiff Location { get; } = new SnapshotDiff(); + public SnapshotDiff Location { get; } = new(); /// Tracks changes to the player's skill levels. public IDictionary> 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 *********/ /// Tracks changes to the window size. - public SnapshotDiff WindowSize { get; } = new SnapshotDiff(); + public SnapshotDiff WindowSize { get; } = new(); /// Tracks changes to the current player. public PlayerSnapshot CurrentPlayer { get; private set; } /// Tracks changes to the time of day (in 24-hour military format). - public SnapshotDiff Time { get; } = new SnapshotDiff(); + public SnapshotDiff Time { get; } = new(); /// Tracks changes to the save ID. - public SnapshotDiff SaveID { get; } = new SnapshotDiff(); + public SnapshotDiff SaveID { get; } = new(); /// Tracks changes to the game's locations. - public WorldLocationsSnapshot Locations { get; } = new WorldLocationsSnapshot(); + public WorldLocationsSnapshot Locations { get; } = new(); /// Tracks changes to . - public SnapshotDiff ActiveMenu { get; } = new SnapshotDiff(); + public SnapshotDiff ActiveMenu { get; } = new(); /// Tracks changes to the cursor position. - public SnapshotDiff Cursor { get; } = new SnapshotDiff(); + public SnapshotDiff Cursor { get; } = new(); /// Tracks changes to the mouse wheel scroll. - public SnapshotDiff MouseWheelScroll { get; } = new SnapshotDiff(); + public SnapshotDiff MouseWheelScroll { get; } = new(); /// Tracks changes to the content locale. - public SnapshotDiff Locale { get; } = new SnapshotDiff(); + public SnapshotDiff 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 *********/ /// A map of tracked locations. - private readonly Dictionary LocationsDict = new Dictionary(new ObjectReferenceComparer()); + private readonly Dictionary LocationsDict = new(new ObjectReferenceComparer()); /********* ** Accessors *********/ /// Tracks changes to the location list. - public SnapshotListDiff LocationList { get; } = new SnapshotListDiff(); + public SnapshotListDiff LocationList { get; } = new(); /// The tracked locations. public IEnumerable Locations => this.LocationsDict.Values; -- cgit