diff options
author | Jesse Plamondon-Willard <Pathoschild@users.noreply.github.com> | 2020-01-01 18:57:05 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-01-01 18:57:05 -0500 |
commit | 00932a335c86be1303ff6443b38d1db629b444fc (patch) | |
tree | 8376207a89b08b4e72c1bcbd46ecd3946e516e5c /src/SMAPI/Events/ChestInventoryChangedEventArgs.cs | |
parent | dca60f42b2048d6b0b27517b9e7686665e61e9c2 (diff) | |
parent | b6aef499d3c9b82d33c75039e0ed58c22618c426 (diff) | |
download | SMAPI-00932a335c86be1303ff6443b38d1db629b444fc.tar.gz SMAPI-00932a335c86be1303ff6443b38d1db629b444fc.tar.bz2 SMAPI-00932a335c86be1303ff6443b38d1db629b444fc.zip |
Merge pull request #686 from wartech0/chest-tracking
Add chest items changed event
Diffstat (limited to 'src/SMAPI/Events/ChestInventoryChangedEventArgs.cs')
-rw-r--r-- | src/SMAPI/Events/ChestInventoryChangedEventArgs.cs | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/src/SMAPI/Events/ChestInventoryChangedEventArgs.cs b/src/SMAPI/Events/ChestInventoryChangedEventArgs.cs new file mode 100644 index 00000000..4b4c4210 --- /dev/null +++ b/src/SMAPI/Events/ChestInventoryChangedEventArgs.cs @@ -0,0 +1,48 @@ +using System; +using System.Collections.Generic; +using StardewValley; +using StardewValley.Objects; + +namespace StardewModdingAPI.Events +{ + /// <summary>Event arguments for a <see cref="IWorldEvents.ChestInventoryChanged"/> event.</summary> + public class ChestInventoryChangedEventArgs : EventArgs + { + /********* + ** Accessors + *********/ + /// <summary>The chest whose inventory changed.</summary> + public Chest Chest { get; } + + /// <summary>The location containing the chest.</summary> + public GameLocation Location { get; } + + /// <summary>The added item stacks.</summary> + public IEnumerable<Item> Added { get; } + + /// <summary>The removed item stacks.</summary> + public IEnumerable<Item> Removed { get; } + + /// <summary>The item stacks whose size changed.</summary> + public IEnumerable<ItemStackSizeChange> QuantityChanged { get; } + + + /********* + ** Public methods + *********/ + /// <summary>Construct an instance.</summary> + /// <param name="chest">The chest whose inventory changed.</param> + /// <param name="location">The location containing the chest.</param> + /// <param name="added">The added item stacks.</param> + /// <param name="removed">The removed item stacks.</param> + /// <param name="quantityChanged">The item stacks whose size changed.</param> + internal ChestInventoryChangedEventArgs(Chest chest, GameLocation location, Item[] added, Item[] removed, ItemStackSizeChange[] quantityChanged) + { + this.Location = location; + this.Chest = chest; + this.Added = added; + this.Removed = removed; + this.QuantityChanged = quantityChanged; + } + } +} |