Loading...
Searching...
No Matches
AdventureCore.ListedInventory Class Reference

Detailed Description

simple implementation of an unlimited inventory that simply stores everything in a list

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

Inheritance diagram for AdventureCore.ListedInventory:
AdventureCore.InventoryBase

Classes

struct  ListedInventoryData
 

Public Member Functions

override void Initialize (CharacterBase character)
 
override bool HasItem (ItemBase item)
 
override IEnumerable< InventoryItemGetItems (ItemBase item)
 
override IEnumerable< InventoryItemGetItems (ItemCategory itemCategory=null, ItemSlotCategory itemSlotCategory=null)
 
override int GetQuantity (ItemBase item)
 
override int GetQuantity (ItemCategory itemCategory=null, ItemSlotCategory itemSlotCategory=null)
 
override bool CanAddItems (ItemQuantity itemQuantity)
 
override InventoryItem AddItems (ItemQuantity itemQuantity)
 
virtual InventoryItem AddItems (ItemQuantity itemQuantity, bool applyCapacities)
 
override bool CanRemoveItems (ItemQuantity itemQuantity)
 
override ItemQuantity RemoveItems (ItemQuantity itemQuantity)
 
override bool CanRemoveItems (InventoryItem inventoryItem, int quantity=1)
 
override ItemQuantity RemoveItems (InventoryItem inventoryItem, int quantity=1)
 
override bool CanUseItems (InventoryItem inventoryItem, int quantity=1)
 
override void UseItems (InventoryItem inventoryItem, int quantity=1)
 
override ItemSlotBase GetSlot (ItemSlotCategory category, int index=0)
 
override ItemSlotBase GetSlot (ItemBase item, int index=0)
 
override T GetSlot< T > (int index=0)
 
int GetCapacity (ItemBase item)
 
int GetRemainingCapacity (ItemBase item)
 
ListedInventoryData GetData ()
 
void Persist ()
 
- Public Member Functions inherited from AdventureCore.InventoryBase
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

PersisterBase Persister
 
ItemSet ItemSet
 
ItemSlotBase[] Slots
 
List< InventoryItemItems
 
List< ItemQuantityCapacities
 
- Public Attributes inherited from AdventureCore.InventoryBase
UnityEvent< ItemQuantityChanging
 
UnityEvent< ItemQuantityChanged
 

Static Public Attributes

const string PERSISTENCE_SUB_KEY = "INV"
 

Protected Member Functions

override void onItemsChanged (ItemQuantity itemQuantity)
 
- Protected Member Functions inherited from AdventureCore.InventoryBase
virtual void onItemsChanging (ItemQuantity itemQuantity)
 

Additional Inherited Members

- Properties inherited from AdventureCore.InventoryBase
CharacterBase Character [get]
 

Member Function Documentation

◆ Initialize()

override void AdventureCore.ListedInventory.Initialize ( CharacterBase character)
inlinevirtual

Reimplemented from AdventureCore.InventoryBase.

◆ onItemsChanged()

override void AdventureCore.ListedInventory.onItemsChanged ( ItemQuantity itemQuantity)
inlineprotectedvirtual

Reimplemented from AdventureCore.InventoryBase.