summaryrefslogtreecommitdiff
path: root/src/StardewModdingAPI/Events/EventArgsInventoryChanged.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/StardewModdingAPI/Events/EventArgsInventoryChanged.cs')
-rw-r--r--src/StardewModdingAPI/Events/EventArgsInventoryChanged.cs36
1 files changed, 27 insertions, 9 deletions
diff --git a/src/StardewModdingAPI/Events/EventArgsInventoryChanged.cs b/src/StardewModdingAPI/Events/EventArgsInventoryChanged.cs
index fa929ab5..40c77419 100644
--- a/src/StardewModdingAPI/Events/EventArgsInventoryChanged.cs
+++ b/src/StardewModdingAPI/Events/EventArgsInventoryChanged.cs
@@ -6,19 +6,37 @@ using StardewValley;
namespace StardewModdingAPI.Events
{
+ /// <summary>Event arguments for a <see cref="PlayerEvents.InventoryChanged"/> event.</summary>
public class EventArgsInventoryChanged : EventArgs
{
- public EventArgsInventoryChanged(List<Item> inventory, List<ItemStackChange> changedItems)
- {
- Inventory = inventory;
- Added = changedItems.Where(n => n.ChangeType == ChangeType.Added).ToList();
- Removed = changedItems.Where(n => n.ChangeType == ChangeType.Removed).ToList();
- QuantityChanged = changedItems.Where(n => n.ChangeType == ChangeType.StackChange).ToList();
- }
-
+ /*********
+ ** Accessors
+ *********/
+ /// <summary>The player's inventory.</summary>
public List<Item> Inventory { get; private set; }
+
+ /// <summary>The added items.</summary>
public List<ItemStackChange> Added { get; private set; }
+
+ /// <summary>The removed items.</summary>
public List<ItemStackChange> Removed { get; private set; }
+
+ /// <summary>The items whose stack sizes changed.</summary>
public List<ItemStackChange> QuantityChanged { get; private set; }
+
+
+ /*********
+ ** Public methods
+ *********/
+ /// <summary>Construct an instance.</summary>
+ /// <param name="inventory">The player's inventory.</param>
+ /// <param name="changedItems">The inventory changes.</param>
+ public EventArgsInventoryChanged(List<Item> inventory, List<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();
+ }
}
-} \ No newline at end of file
+}