Interface IEquipmentInventory
The interface for the equipment inventory. Manages equipped IEquipmentItems, including equipping, unequipping, and getting equipped items.
Namespace: InventorySystem.EquipmentInventory
Assembly: InventorySystem.dll
Syntax
public interface IEquipmentInventory
Properties
| Edit this page View SourceEquippedItemList
List of all currently equipped IEquipmentItems.
Declaration
IReadOnlyList<IEquipmentItem> EquippedItemList { get; }
Property Value
Type | Description |
---|---|
IReadOnlyList<IEquipmentItem> |
Remarks
Does not make a contract about the amount of items inside. Does not contain null values, but can be empty.
Methods
| Edit this page View SourceGetItem(EquipmentType)
Get the IEquipmentItem for slot EquipmentType equipmentType.
Declaration
IEquipmentItem GetItem(EquipmentType equipmentType)
Parameters
Type | Name | Description |
---|---|---|
EquipmentType | equipmentType | The EquipmentType to check for. |
Returns
Type | Description |
---|---|
IEquipmentItem | Returns the equipped IEquipmentItem. Returns null, if no IEquipmentItem is equipped in this slot. |
TryEquip(IItem)
Try to equip an IItem. Returns false if the IItem is not an IEquipmentItem. Returns false if the EquipmentType is not allowed in this IEquipmentInventory. Returns false if an IItem of the same EquipmentType is already equipped.
Declaration
bool TryEquip(IItem item)
Parameters
Type | Name | Description |
---|---|---|
IItem | item | The IItem trying to be equipped. |
Returns
Type | Description |
---|---|
bool | Whether the IItem item was equipped. |
Unequip(EquipmentType)
Try to unequip an IEquipmentItem. Returns null if there was no IEquipmentItem equipped in the slot for EquipmentType equipmentType in EquippedItemList.
Declaration
IEquipmentItem Unequip(EquipmentType equipmentType)
Parameters
Type | Name | Description |
---|---|---|
EquipmentType | equipmentType | The slot that the IEquipmentItem is being removed from. |
Returns
Type | Description |
---|---|
IEquipmentItem | Returns the unequipped IEquipmentItem. Returns null, if there was no item in the EquipmentType in EquippedItemList. |
Events
| Edit this page View SourceItemEquipped
Declaration
event Action<IItem> ItemEquipped
Event Type
Type | Description |
---|---|
Action<IItem> |
ItemUnequipped
Declaration
event Action<IItem> ItemUnequipped
Event Type
Type | Description |
---|---|
Action<IItem> |