ActionAdventureKit 1.7.3
|
base class for inventories, inventories manages items and the slots they are equipped to
in addition to the simple unlimited ListedInventory a possible use cases could be a re4 style case where item stacks have a position and are limited
Public Member Functions | |
virtual void | Initialize (CharacterBase character) |
initializes the inventory including retrieving persisted data | |
bool | HasItem (ItemBase item) |
checks whether the item exists in the inventory, regardless of quantity(may be 0 for stacked items to indicate they have been added at some point) | |
virtual bool | HasItemQuantity (ItemBase item, int quantity=1) |
checks if the inventory has at least the passed quantity of an item | |
IEnumerable< InventoryItem > | GetItems (ItemBase item) |
retrieves all inventory items for a specified item multiple entries may be resturned for items that dont stack- or when the inventory has a maximum stack size | |
IEnumerable< InventoryItem > | GetItems (ItemCategory itemCategory=null, ItemSlotCategory itemSlotCategory=null) |
retrieves all inventory items for a specific category or slot | |
int | GetQuantity (ItemBase item) |
calculates the total stored quantity of an item | |
int | GetQuantity (ItemCategory itemCategory=null, ItemSlotCategory itemSlotCategory=null) |
calculates the total stored quantity of items filtered by an item category and/or slot | |
bool | CanAddItems (ItemQuantity itemQuantity, bool fully=true) |
whether an item quantity can be added to the inventory may be false when the quantity exceeds the capacity | |
int | AddItems (ItemQuantity itemQuantity) |
adds a quantity of an item to the inventory returns the inventory item that was added to or created | |
bool | CanRemoveItems (ItemQuantity itemQuantity, bool fully=true) |
whether a quantity of items is present and can be removed | |
int | RemoveItems (ItemQuantity itemQuantity) |
removes a quantity of items | |
bool | CanRemoveItems (InventoryItem inventoryItem, int quantity=1, bool fully=true) |
whether a quantity of items is present and can be removed from an inventory item | |
int | RemoveItems (InventoryItem inventoryItem, int quantity=1) |
removes specified quantity from the inventory item | |
bool | CanUseItems (InventoryItem inventoryItem, int quantity=1) |
check if a quantity of an inventory item can be used | |
void | UseItems (InventoryItem inventoryItem, int quantity=1) |
uses a quantity of an inventory item can be used | |
bool | CanEquipItems (InventoryItem inventoryItem, int index=0) |
checks if an inventory item can be equipped | |
ItemSlotBase | EquipItems (InventoryItem inventoryItem, int index=0) |
equipps an inventory item to a slot | |
bool | CanUnequipItems (InventoryItem inventoryItem) |
checks if an inventory item can be unequipped | |
ItemSlotBase | UnequipItems (InventoryItem inventoryItem) |
unequips an inventory item | |
ItemSlotBase | GetSlot (ItemSlotCategory category, int index=0) |
retrieves an item slot by its category | |
ItemSlotBase | GetSlot (ItemBase item, int index=0) |
retrieves an item slot for the passed item | |
T | GetSlot< T > (int index=0) |
retrieves an item slot by its type | |
Public Attributes | |
UnityEvent< ItemQuantity > | Changing |
UnityEvent< ItemQuantity > | Changed |
UnityEvent< ItemSlotBase > | EquipmentChanged |
Protected Member Functions | |
virtual void | onItemsChanging (ItemQuantity itemQuantity) |
virtual void | onItemsChanged (ItemQuantity itemQuantity) |
Properties | |
CharacterBase | Character [get] |
|
abstract |
adds a quantity of an item to the inventory
returns the inventory item that was added to or created
itemQuantity | how much and what to add to the inventory |
|
abstract |
whether an item quantity can be added to the inventory
may be false when the quantity exceeds the capacity
itemQuantity | the item and quantity to check |
fully | if the quantity has to be stored entirely |
|
abstract |
checks if an inventory item can be equipped
inventoryItem | the inventory item to equip |
index | index of the slot to equip to if there are multiple(for example left/right arm in souls) |
|
abstract |
whether a quantity of items is present and can be removed from an inventory item
inventoryItem | the inventory item to remove from |
quantity | how much to remove |
fully | if the quantity has to be stored entirely |
|
abstract |
whether a quantity of items is present and can be removed
itemQuantity | how much and what to remove from the inventory |
fully | if the quantity has to be stored entirely |
|
abstract |
checks if an inventory item can be unequipped
inventoryItem | the inventory item to unequip |
|
abstract |
check if a quantity of an inventory item can be used
inventoryItem | the inventory item to use |
quantity | how many to use |
|
abstract |
equipps an inventory item to a slot
inventoryItem | the inventory item to equip |
index | index of the slot to equip to if there are multiple(for example left/right arm in souls) |
|
abstract |
retrieves all inventory items for a specified item
multiple entries may be resturned for items that dont stack-
or when the inventory has a maximum stack size
item | the item to check |
|
abstract |
retrieves all inventory items for a specific category or slot
itemCategory | the category to filter items for |
itemSlotCategory | the slot to filter items for |
|
abstract |
calculates the total stored quantity of an item
item | the item to sum quantities for |
|
abstract |
calculates the total stored quantity of items filtered by an item category and/or slot
itemCategory | the category to filter items for |
itemSlotCategory | the slot to filter items for |
|
abstract |
retrieves an item slot for the passed item
item | the item to retrieve a slot for |
index | when there are mutliple slots in one category(sould left/right weapon slots) |
|
abstract |
retrieves an item slot by its category
category | the category of the slot(helmet, shield, ...) |
index | when there are mutliple slots in one category(sould left/right weapon slots) |
|
abstract |
retrieves an item slot by its type
T | the type of the item slot |
index | when there are mutliple slots in one category(sould left/right weapon slots) |
T | : | ItemSlotBase |
|
abstract |
checks whether the item exists in the inventory, regardless of quantity(may be 0 for stacked items to indicate they have been added at some point)
item |
|
virtual |
checks if the inventory has at least the passed quantity of an item
item | the item to check |
quantity | the minimum quantity needed |
|
inlinevirtual |
initializes the inventory including retrieving persisted data
character | the owner of the inventory |
Reimplemented in AdventureCore.ListedInventory.
|
abstract |
removes specified quantity from the inventory item
inventoryItem | the inventory item to remove from |
quantity | the quantity to remove |
|
abstract |
removes a quantity of items
itemQuantity | how much and what to remove |
|
abstract |
unequips an inventory item
inventoryItem | the inventory item to unequip |
|
abstract |
uses a quantity of an inventory item can be used
inventoryItem | the inventory item to use |
quantity | how many to use |