using System; using System.Collections.Generic; using System.Linq; using StardewModdingAPI.Inheritance; using StardewValley; namespace StardewModdingAPI.Events { /// Event arguments for a event. public class EventArgsInventoryChanged : EventArgs { /********* ** Accessors *********/ /// The player's inventory. public List Inventory { get; private set; } /// The added items. public List Added { get; private set; } /// The removed items. public List Removed { get; private set; } /// The items whose stack sizes changed. public List QuantityChanged { get; private set; } /********* ** Public methods *********/ /// Construct an instance. /// The player's inventory. /// The inventory changes. public EventArgsInventoryChanged(List inventory, List 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(); } } }