using System; using System.Collections.Generic; using System.Linq; using StardewValley; namespace StardewModdingAPI.Events { /// Event arguments for a event. public class EventArgsInventoryChanged : EventArgs { /********* ** Accessors *********/ /// The player's inventory. public IList Inventory { get; } /// The added items. public List Added { get; } /// The removed items. public List Removed { get; } /// The items whose stack sizes changed. public List QuantityChanged { get; } /********* ** Public methods *********/ /// Construct an instance. /// The player's inventory. /// The inventory changes. public EventArgsInventoryChanged(IList inventory, ItemStackChange[] changedItems) { this.Inventory = inventory; this.Added = changedItems.Where(n => n.ChangeType == ChangeType.Added).ToList(); this.Removed = changedItems.Where(n => n.ChangeType == ChangeType.Removed).ToList(); this.QuantityChanged = changedItems.Where(n => n.ChangeType == ChangeType.StackChange).ToList(); } } }