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

Detailed Description

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

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

Inheritance diagram for AdventureCore.ItemSlotSurrogate:
AdventureCore.ItemSlotBase

Public Member Functions

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

Public Attributes

string CharacterId
 
ItemBase TargetItem
 
ItemSlotCategory TargetCategory
 
int TargetIndex
 
- Public Attributes inherited from AdventureCore.ItemSlotBase
string Key
 
ItemSlotCategory Category
 
int Index
 

Properties

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

Additional Inherited Members

- Protected Member Functions inherited from AdventureCore.ItemSlotBase
virtual InventoryItem getPrevious (bool clear=true)
 
virtual InventoryItem getNext (bool clear=true)
 
virtual void onEquippedInventoryItemChanged ()
 
virtual void onIsInUseChanged ()
 
virtual void onIsHiddenChanged ()
 
virtual void onUsingItem (int quantity)
 
- Events inherited from AdventureCore.ItemSlotBase
Action< bool > IsInUseChanged
 
Action< bool > IsHiddenChanged
 
Action< InventoryItemEquippedInventoryItemChanged
 
Action< int > UsingItem
 

Member Function Documentation

◆ CanClear()

override bool AdventureCore.ItemSlotSurrogate.CanClear ( )
virtual

checks whether the slot can be cleared of its equipped items

Returns
true if it is possible to unequip the current item

Reimplemented from AdventureCore.ItemSlotBase.

◆ CanEquip()

override bool AdventureCore.ItemSlotSurrogate.CanEquip ( InventoryItem inventoryItem,
bool clear = true )
virtual

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 from AdventureCore.ItemSlotBase.

◆ CanEquipNext()

override bool AdventureCore.ItemSlotSurrogate.CanEquipNext ( bool clear = true)
virtual

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

Reimplemented from AdventureCore.ItemSlotBase.

◆ CanEquipPrevious()

override bool AdventureCore.ItemSlotSurrogate.CanEquipPrevious ( bool clear = true)
virtual

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

Reimplemented from AdventureCore.ItemSlotBase.

◆ CanUse()

override bool AdventureCore.ItemSlotSurrogate.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 from AdventureCore.ItemSlotBase.

◆ Clear()

override void AdventureCore.ItemSlotSurrogate.Clear ( )
virtual

clears the slot of its currently equipped item

Reimplemented from AdventureCore.ItemSlotBase.

◆ Equip()

override void AdventureCore.ItemSlotSurrogate.Equip ( InventoryItem inventoryItem)
virtual

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

Parameters
inventoryItemthe inventory item to equip

Reimplemented from AdventureCore.ItemSlotBase.

◆ EquipNext()

override bool AdventureCore.ItemSlotSurrogate.EquipNext ( bool clear = true)
virtual

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

Reimplemented from AdventureCore.ItemSlotBase.

◆ EquipPrevious()

override bool AdventureCore.ItemSlotSurrogate.EquipPrevious ( bool clear = true)
virtual

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

Reimplemented from AdventureCore.ItemSlotBase.

◆ Hide()

override void AdventureCore.ItemSlotSurrogate.Hide ( )
virtual

hides the slot

Reimplemented from AdventureCore.ItemSlotBase.

◆ Show()

override void AdventureCore.ItemSlotSurrogate.Show ( )
virtual

shows the slot if it was hidden before

Reimplemented from AdventureCore.ItemSlotBase.

◆ Use()

override void AdventureCore.ItemSlotSurrogate.Use ( int quantity = 1)
virtual

uses the equipped item

Parameters
quantityhow many to use

Reimplemented from AdventureCore.ItemSlotBase.