From 1286a90ec2fb0dcf26bd59feec714544844e4398 Mon Sep 17 00:00:00 2001 From: Jesse Plamondon-Willard Date: Sun, 29 Dec 2019 13:29:25 -0500 Subject: minor refactoring This commit... - removes key fields added to non-keyed types like NetListWatcher and SnapshotListDiff; - fixes existing chests not being watched; - fixes diffs not correctly updated for added/removed chests; - performs minor cleanup, adds missing docs, etc. --- src/SMAPI/Framework/Events/EventManager.cs | 6 +++--- src/SMAPI/Framework/Events/ModWorldEvents.cs | 7 ++++--- 2 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/SMAPI/Framework/Events') diff --git a/src/SMAPI/Framework/Events/EventManager.cs b/src/SMAPI/Framework/Events/EventManager.cs index dad45f95..892cbc7b 100644 --- a/src/SMAPI/Framework/Events/EventManager.cs +++ b/src/SMAPI/Framework/Events/EventManager.cs @@ -148,8 +148,8 @@ namespace StardewModdingAPI.Framework.Events /// Raised after objects are added or removed in a location. public readonly ManagedEvent ObjectListChanged; - /// Raised after a new item is added or removed from a chest in a location. - public readonly ManagedEvent ChestItemsChanged; + /// Raised after items are added or removed from a chest. + public readonly ManagedEvent ChestInventoryChanged; /// Raised after terrain features (like floors and trees) are added or removed in a location. public readonly ManagedEvent TerrainFeatureListChanged; @@ -224,7 +224,7 @@ namespace StardewModdingAPI.Framework.Events this.LocationListChanged = ManageEventOf(nameof(IModEvents.World), nameof(IWorldEvents.BuildingListChanged)); this.NpcListChanged = ManageEventOf(nameof(IModEvents.World), nameof(IWorldEvents.NpcListChanged)); this.ObjectListChanged = ManageEventOf(nameof(IModEvents.World), nameof(IWorldEvents.ObjectListChanged)); - this.ChestItemsChanged = ManageEventOf(nameof(IModEvents.World), nameof(IWorldEvents.ChestItemChanged)); + this.ChestInventoryChanged = ManageEventOf(nameof(IModEvents.World), nameof(IWorldEvents.ChestInventoryChanged)); this.TerrainFeatureListChanged = ManageEventOf(nameof(IModEvents.World), nameof(IWorldEvents.TerrainFeatureListChanged)); this.LoadStageChanged = ManageEventOf(nameof(IModEvents.Specialized), nameof(ISpecializedEvents.LoadStageChanged)); diff --git a/src/SMAPI/Framework/Events/ModWorldEvents.cs b/src/SMAPI/Framework/Events/ModWorldEvents.cs index 8d6701ec..2ae69669 100644 --- a/src/SMAPI/Framework/Events/ModWorldEvents.cs +++ b/src/SMAPI/Framework/Events/ModWorldEvents.cs @@ -51,10 +51,11 @@ namespace StardewModdingAPI.Framework.Events remove => this.EventManager.ObjectListChanged.Remove(value); } - public event EventHandler ChestItemChanged + /// Raised after items are added or removed from a chest. + public event EventHandler ChestInventoryChanged { - add => this.EventManager.ChestItemsChanged.Add(value); - remove => this.EventManager.ChestItemsChanged.Remove(value); + add => this.EventManager.ChestInventoryChanged.Add(value); + remove => this.EventManager.ChestInventoryChanged.Remove(value); } /// Raised after terrain features (like floors and trees) are added or removed in a location. -- cgit