Inventory
Class in SurvivEngine.Items namespace
Implements IEnumerable<ItemSlot>
Class in SurvivEngine.Items namespace
Implements IEnumerable<ItemSlot>
A collection of item slots for holding items. Provides various ways to change or add items.
Read-Only
Returns the currently selected slot of this inventory, based on the selected slot index.
Read-Only
Returns true if there are no more empty slots left.
Read-Only
The total size in item slots of this inventory, defined on creation.
Gets or sets the currently selected slot index of this inventory.
Called when anything about the inventory changes. Uses the inventory instance as an argument.
Called when an item is introduced into the inventory. Uses the newly added item as an argument.
Called when the selected slot index is changed. Uses the new selected index as an argument.
Transfers as many items as possible between the two given inventories.
from The inventory to transfer from.
to The inventory to transfer to.
Removes all items from all item slots in the inventory.
Adds the given item into the inventory, either by adding to a stack or in an empty slot.
item The item to add.
Creates a new instance of an item with the given ID and count inside this inventory.
itemID The item ID of the item to be created.
count The count of the item to be created.
Checks whether or not this inventory contains all of the given item IDs and counts.
itemsToMatch The collection of IDs and counts to check.
Checks whether or not this inventory contains the given item ID and count.
itemID The item ID to check.
minimumCount The count of the item to check.
Removes a set of items by their ID and count from this inventory.
itemsToRemove The collection of IDs and counts to remove.
Removes an item by the given ID and count from this inventory.
itemID The item ID of the item to remove.
count The count of the item to remove.
Attempts to find the slot index within this inventory of the given item.
item The item to find.