Loading...
Searching...
No Matches
AdventureCore.InventoryBase Class Referenceabstract

Detailed Description

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

https://adventure.softleitner.com/manual/item

Inheritance diagram for AdventureCore.InventoryBase:
AdventureCore.ListedInventory

Public Member Functions

virtual void Initialize (CharacterBase character)
 
bool HasItem (ItemBase item)
 checks whether the item exists in the inventory, regardless of quantity(may be 0)
 
virtual bool HasItemQuantity (ItemBase item, int quantity=1)
 
IEnumerable< InventoryItemGetItems (ItemBase item)
 
IEnumerable< InventoryItemGetItems (ItemCategory itemCategory=null, ItemSlotCategory itemSlotCategory=null)
 
int GetQuantity (ItemBase item)
 
int GetQuantity (ItemCategory itemCategory=null, ItemSlotCategory itemSlotCategory=null)
 
bool CanAddItems (ItemQuantity itemQuantity)
 
InventoryItem AddItems (ItemQuantity itemQuantity)
 
bool CanRemoveItems (ItemQuantity itemQuantity)
 
ItemQuantity RemoveItems (ItemQuantity itemQuantity)
 
bool CanRemoveItems (InventoryItem inventoryItem, int quantity=1)
 
ItemQuantity RemoveItems (InventoryItem inventoryItem, int quantity=1)
 
bool CanUseItems (InventoryItem inventoryItem, int quantity=1)
 
void UseItems (InventoryItem inventoryItem, int quantity=1)
 
ItemSlotBase GetSlot (ItemSlotCategory category, int index=0)
 
ItemSlotBase GetSlot (ItemBase item, int index=0)
 
GetSlot< T > (int index=0)
 

Public Attributes

UnityEvent< ItemQuantityChanging
 
UnityEvent< ItemQuantityChanged
 

Protected Member Functions

virtual void onItemsChanging (ItemQuantity itemQuantity)
 
virtual void onItemsChanged (ItemQuantity itemQuantity)
 

Properties

CharacterBase Character [get]
 

Member Function Documentation

◆ GetSlot< T >()

T AdventureCore.InventoryBase.GetSlot< T > ( int index = 0)
abstract
Type Constraints
T :ItemSlotBase 

◆ HasItem()

bool AdventureCore.InventoryBase.HasItem ( ItemBase item)
abstract

checks whether the item exists in the inventory, regardless of quantity(may be 0)

Parameters
item
Returns