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

Detailed Description

non-generic base class for item slots, usually the generic ItemSlot<T> should be derived from this

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

Inheritance diagram for AdventureCore.ItemSlotBase:
AdventureCore.ItemSlot< T > AdventureCore.ItemSlotProxy AdventureSouls.SoulsUsableSlots

Public Member Functions

virtual void Initialize (CharacterBase character)
 
virtual bool CanEquipPrevious (bool clear=true)
 checks if the slot can switch its equipped item to the previous one in its characters inventory
 
virtual bool EquipPrevious (bool clear=true)
 equips the previous item in its characters inventory
 
virtual bool CanEquipNext (bool clear=true)
 checks if the slot can switch its equipped item to the next one in its characters inventory
 
virtual bool EquipNext (bool clear=true)
 equips the next item in its characters inventory
 
virtual bool CanEquip (InventoryItem inventoryItem, bool clear=true)
 checks if an inventory item can be equipped
 
virtual void Equip (InventoryItem inventoryItem)
 equips an inventory item(if another item is already equipped it is unequipped first)
 
virtual bool CanClear ()
 checks whether the slot can be cleared of its equipped items
 
virtual void Clear ()
 clears the slot of its currently equipped item
 
virtual void Show ()
 shows the slot if it was hidden before
 
virtual void Hide ()
 hides the slot
 
virtual bool CanUse (int quantity=1)
 checks if the equipped item can be used
 
virtual void Use (int quantity=1)
 uses the equipped item
 

Public Attributes

string Key
 
ItemSlotCategory Category
 
int Index
 

Protected Member Functions

virtual InventoryItem getPrevious (bool clear=true)
 
virtual InventoryItem getNext (bool clear=true)
 
virtual void onEquippedInventoryItemChanged ()
 
virtual void onIsInUseChanged ()
 
virtual void onIsHiddenChanged ()
 

Properties

virtual InventoryItem EquippedInventoryItem [get]
 
bool IsHidden [get]
 
virtual bool IsInUse [get, set]
 
Type ItemType [get]
 
CharacterBase Character [get]
 

Events

Action< bool > IsInUseChanged
 
Action< bool > IsHiddenChanged
 
Action< InventoryItemEquippedInventoryItemChanged
 

Member Function Documentation

◆ CanClear()

virtual bool AdventureCore.ItemSlotBase.CanClear ( )
inlinevirtual

checks whether the slot can be cleared of its equipped items

Returns
true if it is possible to unequip the current item

◆ CanEquip()

virtual bool AdventureCore.ItemSlotBase.CanEquip ( InventoryItem inventoryItem,
bool clear = true )
inlinevirtual

checks if an inventory item can be equipped

Parameters
inventoryItemthe inventory item to equip
clearwhether clearing the slot by equipping null is valid
Returns
true if the item can be equipped

Reimplemented in AdventureCore.ItemSlot< T >.

◆ CanEquipNext()

virtual bool AdventureCore.ItemSlotBase.CanEquipNext ( bool clear = true)
inlinevirtual

checks if the slot can switch its equipped item to the next one in its characters inventory

Parameters
clearwhether one of the spaces to switch into is empty
Returns
whether switching is possible

◆ CanEquipPrevious()

virtual bool AdventureCore.ItemSlotBase.CanEquipPrevious ( bool clear = true)
inlinevirtual

checks if the slot can switch its equipped item to the previous one in its characters inventory

Parameters
clearwhether one of the spaces to switch into is empty
Returns
whether switching is possible

◆ CanUse()

virtual bool AdventureCore.ItemSlotBase.CanUse ( int quantity = 1)
virtual

checks if the equipped item can be used

Parameters
quantityhow many of the item to use
Returns
true if the equipped item can be used

Reimplemented in AdventureCore.ItemSlotProxy.

◆ Clear()

virtual void AdventureCore.ItemSlotBase.Clear ( )
inlinevirtual

clears the slot of its currently equipped item

Reimplemented in AdventureCore.ItemSlot< T >, and AdventureCore.ItemSlotProxy.

◆ Equip()

virtual void AdventureCore.ItemSlotBase.Equip ( InventoryItem inventoryItem)
inlinevirtual

equips an inventory item(if another item is already equipped it is unequipped first)

Parameters
inventoryItemthe inventory item to equip

Reimplemented in AdventureCore.ItemSlot< T >, and AdventureCore.ItemSlotProxy.

◆ EquipNext()

virtual bool AdventureCore.ItemSlotBase.EquipNext ( bool clear = true)
inlinevirtual

equips the next item in its characters inventory

Parameters
clearwhether one of the spaces to switch into is empty
Returns
whether a different item was equipped

◆ EquipPrevious()

virtual bool AdventureCore.ItemSlotBase.EquipPrevious ( bool clear = true)
inlinevirtual

equips the previous item in its characters inventory

Parameters
clearwhether one of the spaces to switch into is empty
Returns
whether a different item was equipped

◆ Hide()

virtual void AdventureCore.ItemSlotBase.Hide ( )
inlinevirtual

hides the slot

Reimplemented in AdventureCore.ItemSlotProxy.

◆ Show()

virtual void AdventureCore.ItemSlotBase.Show ( )
inlinevirtual

shows the slot if it was hidden before

Reimplemented in AdventureCore.ItemSlotProxy.

◆ Use()

virtual void AdventureCore.ItemSlotBase.Use ( int quantity = 1)
virtual

uses the equipped item

Parameters
quantityhow many to use

Reimplemented in AdventureCore.ItemSlotProxy.