ActionAdventureKit 1.9.3
|
placeholder that redirects to an actual component when a character with a specified id is available
can be used to bind things like UI to components of characters that will spawn during gameplay
Public Member Functions | |
override 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) | |
override bool | HasItemQuantity (ItemBase item, int quantity=1) |
checks if the inventory has at least the passed quantity of an item | |
override InventoryItem | GetItem (ItemBase item) |
retrieves the first inventory item for a specified item | |
override 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 | |
override IEnumerable< InventoryItem > | GetItems (ItemCategory itemCategory=null, ItemSlotCategory itemSlotCategory=null) |
retrieves all inventory items for a specific category or slot | |
override int | GetQuantity (ItemBase item) |
calculates the total stored quantity of an item | |
override int | GetQuantity (ItemCategory itemCategory=null, ItemSlotCategory itemSlotCategory=null) |
calculates the total stored quantity of items filtered by an item category and/or slot | |
override 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 | |
override int | AddItems (ItemQuantity itemQuantity) |
adds a quantity of an item to the inventory | |
override bool | CanRemoveItems (ItemQuantity itemQuantity, bool fully=true) |
whether a quantity of items is present and can be removed | |
override int | RemoveItems (ItemQuantity itemQuantity) |
removes a quantity of items | |
override 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 | |
override int | RemoveItems (InventoryItem inventoryItem, int quantity=1) |
removes specified quantity from the inventory item | |
override void | Clear () |
unequips and removes all items from the inventory | |
override bool | CanUseItems (InventoryItem inventoryItem, int quantity=1) |
check if a quantity of an inventory item can be used | |
override void | UseItems (InventoryItem inventoryItem, int quantity=1) |
uses a quantity of an inventory item can be used | |
override bool | CanEquipItems (InventoryItem inventoryItem, int? index=null) |
checks if an inventory item can be equipped | |
override ItemSlotBase | EquipItems (InventoryItem inventoryItem, int? index=null) |
equipps an inventory item to a slot | |
override bool | CanUnequipItems (InventoryItem inventoryItem) |
checks if an inventory item can be unequipped | |
override ItemSlotBase | UnequipItems (InventoryItem inventoryItem) |
unequips an inventory item | |
override bool | CheckItemValue (InventoryItem inventoryItem, string key) |
override void | SetItemValue< T > (InventoryItem inventoryItem, string key, T value) |
override T | GetItemValue< T > (InventoryItem inventoryItem, string key, T defaultValue) |
override ItemSlotBase | GetSlot (ItemSlotCategory category, int? index=null) |
retrieves an item slot by its category | |
override ItemSlotBase | GetSlot (ItemBase item, int? index=null) |
retrieves an item slot for the passed item | |
override T | GetSlot< T > (int? index=null) |
retrieves an item slot by its type | |
override ItemSlotBase | GetEmptySlot (ItemSlotCategory category, int? index=null) |
retrieves an empty item slot by its category | |
override ItemSlotBase | GetEmptySlot (ItemBase item, int? index=null) |
retrieves an empty item slot for the passed item | |
override T | GetEmptySlot< T > (int? index=null) |
retrieves an empty item slot by its type | |
override int | GetCapacity (ItemBase item) |
override int | GetRemainingCapacity (ItemBase item) |
override bool | Retrieve () |
override void | Persist () |
override TiledInventoryData | GetData () |
![]() | |
Vector2Int | Clamp (Vector2Int position) |
Vector2Int | Clamp (Vector2Int position, Vector2Int size, bool rotated) |
bool | CanMove (TiledInventoryItem item, Vector2Int position, bool rotated) |
void | Move (TiledInventoryItem item, Vector2Int position, bool rotated) |
bool | CanRotate (TiledInventoryItem item) |
void | Rotate (TiledInventoryItem item) |
void | CanResize (TiledInventoryItem item, Vector2Int size) |
void | Resize (TiledInventoryItem item, Vector2Int size) |
bool | CanSort () |
bool | Sort () |
override bool | Retrieve () |
override void | Persist () |
![]() | |
virtual void | Initialize (CharacterBase character) |
initializes the inventory including retrieving persisted data | |
void | SetItemStringValue (InventoryItem inventoryItem, string key, string value) |
string | GetItemStringValue (InventoryItem inventoryItem, string key, string defaultValue) |
void | SetItemIntValue (InventoryItem inventoryItem, string key, int value) |
int | GetItemIntValue (InventoryItem inventoryItem, string key, int defaultValue) |
void | SetItemFloatValue (InventoryItem inventoryItem, string key, float value) |
float | GetItemFloatValue (InventoryItem inventoryItem, string key, float defaultValue) |
void | SetItemBoolValue (InventoryItem inventoryItem, string key, bool value) |
bool | GetItemBoolValue (InventoryItem inventoryItem, string key, bool defaultValue) |
bool | Retrieve () |
fills inventory with data retrieved from persister | |
void | Persist () |
saves inventory data to persister | |
Public Attributes | |
string | CharacterId |
![]() | |
List< TiledInventoryItem > | Items = new List<TiledInventoryItem>() |
Vector2Int | InventorySize = new Vector2Int(16, 8) |
TiledInventorySize[] | ItemSizes |
![]() | |
PersisterBase | Persister |
bool | PersistManual |
ItemSet | ItemSet |
bool | EquipOnAdded |
bool | UnequipOnEmpty |
ItemSlotBase[] | Slots |
List< ItemQuantity > | Capacities |
UnityEvent< ItemQuantity > | Changing |
UnityEvent< ItemQuantity > | Changed |
UnityEvent< ItemSlotBase > | EquipmentChanged |
Protected Member Functions | |
override int | add (ItemQuantity itemQuantity) |
override void | remove (InventoryItem inventoryItem) |
![]() | |
override int | add (ItemQuantity itemQuantity) |
override void | remove (InventoryItem inventoryItem) |
override void | clear () |
bool | tryGetPosition (Vector2Int size, out Vector2Int position, out bool rotated, List< TiledInventoryItem > items=null) |
bool | checkAvailable (Vector2Int position, Vector2Int size, bool rotated, List< TiledInventoryItem > items=null) |
bool | checkAvailable (Vector2Int position, Vector2Int size, bool rotated, TiledInventoryItem movingItem) |
InventoryItem | getInventoryItem (Vector2Int position, List< TiledInventoryItem > items=null) |
Vector2Int | getSize (ItemBase item) |
![]() | |
virtual void | onItemsChanging (ItemQuantity itemQuantity) |
virtual void | onItemsChanged (ItemQuantity itemQuantity) |
virtual void | onItemValueChanged (InventoryItem inventoryItem, string key) |
int | add (ItemQuantity itemQuantity) |
void | remove (InventoryItem inventoryItem) |
void | clear () |
Properties | |
override ObservableCollection< TiledInventoryItem > | ObservableItems [get] |
![]() | |
override IReadOnlyList< InventoryItem > | InventoryItems [get] |
virtual ObservableCollection< TiledInventoryItem > | ObservableItems [get] |
![]() | |
CharacterBase | Character [get] |
IReadOnlyList< InventoryItem > | InventoryItems [get] |
Additional Inherited Members | |
![]() | |
const string | PERSISTENCE_SUB_KEY = "INV" |
![]() | |
bool | _isInitialized |
bool | _isChanging |
|
virtual |
adds a quantity of an item to the inventory
itemQuantity | how much and what to add to the inventory |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
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 |
Reimplemented from AdventureCore.TiledInventory.
|
virtual |
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) |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
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 |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
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 removed entirely |
Reimplemented from AdventureCore.TiledInventory.
|
virtual |
checks if an inventory item can be unequipped
inventoryItem | the inventory item to unequip |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
check if a quantity of an inventory item can be used
inventoryItem | the inventory item to use |
quantity | how many to use |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
unequips and removes all items from the inventory
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
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) |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
Reimplemented from AdventureCore.TiledInventory.
|
virtual |
retrieves an empty item slot for the passed item
item | the item to retrieve a slot for |
index | when there are mutliple slots in one category(souls left/right weapon slots) |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
retrieves an empty item slot by its category
category | the category of the slot(helmet, shield, ...) |
index | when there are mutliple slots in one category(souls left/right weapon slots) |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
retrieves an empty item slot by its type
T | the type of the item slot |
index | when there are mutliple slots in one category(souls left/right weapon slots) |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
retrieves the first inventory item for a specified item
item | the item to check |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
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 |
Reimplemented from AdventureCore.InventoryBase.
|
inlinevirtual |
retrieves all inventory items for a specific category or slot
itemCategory | the category to filter items for |
itemSlotCategory | the slot to filter items for |
Reimplemented from AdventureCore.InventoryBase.
|
inlinevirtual |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
calculates the total stored quantity of an item
item | the item to sum quantities for |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
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 |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
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) |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
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) |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
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) |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
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 |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
checks if the inventory has at least the passed quantity of an item
item | the item to check |
quantity | the minimum quantity needed |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
removes specified quantity from the inventory item
inventoryItem | the inventory item to remove from |
quantity | the quantity to remove |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
removes a quantity of items
itemQuantity | how much and what to remove |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
unequips an inventory item
inventoryItem | the inventory item to unequip |
Reimplemented from AdventureCore.InventoryBase.
|
virtual |
uses a quantity of an inventory item can be used
inventoryItem | the inventory item to use |
quantity | how many to use |
Reimplemented from AdventureCore.InventoryBase.