diff options
Diffstat (limited to 'src/SMAPI/Events')
-rw-r--r-- | src/SMAPI/Events/ChestInventoryChangedEventArgs.cs (renamed from src/SMAPI/Events/ChestItemChangedEventArgs.cs) | 20 | ||||
-rw-r--r-- | src/SMAPI/Events/IWorldEvents.cs | 4 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/SMAPI/Events/ChestItemChangedEventArgs.cs b/src/SMAPI/Events/ChestInventoryChangedEventArgs.cs index 6b06487c..0b54e909 100644 --- a/src/SMAPI/Events/ChestItemChangedEventArgs.cs +++ b/src/SMAPI/Events/ChestInventoryChangedEventArgs.cs @@ -3,28 +3,27 @@ using System.Collections.Generic; using System.Linq; using Microsoft.Xna.Framework; using StardewValley; -using Item = StardewValley.Item; namespace StardewModdingAPI.Events { - /// <summary>Event arguments for a <see cref="IWorldEvents.ChestItemChanged"/> event.</summary> - public class ChestItemChangedEventArgs : EventArgs + /// <summary>Event arguments for a <see cref="IWorldEvents.ChestInventoryChanged"/> event.</summary> + public class ChestInventoryChangedEventArgs : EventArgs { /********* ** Accessors *********/ - /// <summary>The location which changed.</summary> + /// <summary>The location containing the chest.</summary> public GameLocation Location { get; } + /// <summary>The tile position of the chest.</summary> + public Vector2 Tile { get; } + /// <summary>The objects added to the location.</summary> public IEnumerable<Item> Added { get; } /// <summary>The objects removed from the location.</summary> public IEnumerable<Item> Removed { get; } - /// <summary>The location of the chest from where the item was added or removed</summary> - public Vector2 LocationOfChest { get; } - /// <summary>Whether this is the location containing the local player.</summary> public bool IsCurrentLocation => object.ReferenceEquals(this.Location, Game1.player?.currentLocation); @@ -33,15 +32,16 @@ namespace StardewModdingAPI.Events ** Public methods *********/ /// <summary>Construct an instance.</summary> - /// <param name="location">The location which changed.</param> + /// <param name="location">The location containing the chest.</param> + /// <param name="tile">The tile position of the chest.</param> /// <param name="added">The objects added to the location.</param> /// <param name="removed">The objects removed from the location.</param> - internal ChestItemChangedEventArgs(GameLocation location, IEnumerable<Item> added, IEnumerable<Item> removed, Vector2 locationOfChest) + internal ChestInventoryChangedEventArgs(GameLocation location, Vector2 tile, IEnumerable<Item> added, IEnumerable<Item> removed) { this.Location = location; + this.Tile = tile; this.Added = added.ToArray(); this.Removed = removed.ToArray(); - this.LocationOfChest = locationOfChest; } } } diff --git a/src/SMAPI/Events/IWorldEvents.cs b/src/SMAPI/Events/IWorldEvents.cs index 6f9b71a7..9569a57b 100644 --- a/src/SMAPI/Events/IWorldEvents.cs +++ b/src/SMAPI/Events/IWorldEvents.cs @@ -23,8 +23,8 @@ namespace StardewModdingAPI.Events /// <summary>Raised after objects are added or removed in a location.</summary> event EventHandler<ObjectListChangedEventArgs> ObjectListChanged; - /// <summary>Raised after items are added or removed from a chest in a location.</summary> - event EventHandler<ChestItemChangedEventArgs> ChestItemChanged; + /// <summary>Raised after items are added or removed from a chest.</summary> + event EventHandler<ChestInventoryChangedEventArgs> ChestInventoryChanged; /// <summary>Raised after terrain features (like floors and trees) are added or removed in a location.</summary> event EventHandler<TerrainFeatureListChangedEventArgs> TerrainFeatureListChanged; |