Loading...
Searching...
No Matches
AdventureCore.ItemSlot< T > Class Template Referenceabstract

Detailed Description

generic base class for item slots, slots are used to equip items
the protected equip(T) and unequip(T) are most important for equipment behaviour
for example a helmet item on an amor slot may instantiate some visual and add a modifier to the characters defense in equip, in unequip it would destroy the visual and remove the modifier
canEquip can be overridden to define whether a specific item can be equipped at the moment, applyVisibility is used when a slot is hidden(like weapons being hidden while pulling a lever)

Template Parameters
T
Type Constraints
T :ItemBase 
Inheritance diagram for AdventureCore.ItemSlot< T >:
AdventureCore.ItemSlotBase

Public Member Functions

override void Initialize (CharacterBase character)
 
override bool CanEquip (InventoryItem inventoryItem)
 
override void Equip (InventoryItem inventoryItem)
 
override void Clear ()
 
override void Show ()
 
override void Hide ()
 
- Public Member Functions inherited from AdventureCore.ItemSlotBase
virtual void EquipPrevious (bool clear=true)
 
virtual void EquipNext (bool clear=true)
 
virtual bool CanUse (int quantity=1)
 
virtual void Use (int quantity=1)
 

Public Attributes

FallbackItem
 
- Public Attributes inherited from AdventureCore.ItemSlotBase
string Key
 
ItemSlotCategory Category
 
int Index
 

Protected Member Functions

virtual bool canEquip (T item)
 
virtual void equip (T item)
 
virtual void unequip (T item)
 
virtual void applyVisibility ()
 
- Protected Member Functions inherited from AdventureCore.ItemSlotBase
virtual void onEquippedInventoryItemChanged ()
 
virtual void onIsInUseChanged ()
 

Properties

EquippedItem [get]
 
override Type ItemType [get]
 
- Properties inherited from AdventureCore.ItemSlotBase
virtual InventoryItem EquippedInventoryItem [get]
 
bool IsHidden [get]
 
virtual bool IsInUse [get, set]
 
Type ItemType [get]
 
CharacterBase Character [get]
 

Additional Inherited Members

- Events inherited from AdventureCore.ItemSlotBase
Action< bool > IsInUseChanged
 
Action< InventoryItemEquippedInventoryItemChanged
 

Member Function Documentation

◆ CanEquip()

override bool AdventureCore.ItemSlot< T >.CanEquip ( InventoryItem inventoryItem)
inlinevirtual

Reimplemented from AdventureCore.ItemSlotBase.

◆ Clear()

override void AdventureCore.ItemSlot< T >.Clear ( )
inlinevirtual

Reimplemented from AdventureCore.ItemSlotBase.

◆ Equip()

override void AdventureCore.ItemSlot< T >.Equip ( InventoryItem inventoryItem)
inlinevirtual

Reimplemented from AdventureCore.ItemSlotBase.

◆ Hide()

override void AdventureCore.ItemSlot< T >.Hide ( )
inlinevirtual

Reimplemented from AdventureCore.ItemSlotBase.

◆ Initialize()

override void AdventureCore.ItemSlot< T >.Initialize ( CharacterBase character)
inlinevirtual

Reimplemented from AdventureCore.ItemSlotBase.

◆ Show()

override void AdventureCore.ItemSlot< T >.Show ( )
inlinevirtual

Reimplemented from AdventureCore.ItemSlotBase.