Inventory System
Search Results for

    Show / Hide Table of Contents

    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 Source

    EquippedItemList

    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 Source

    GetItem(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.

    | Edit this page View Source

    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.

    | Edit this page View Source

    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 Source

    ItemEquipped

    Event invoked when an IItem was successfully equipped. Returns the newly equipped IItem.

    Declaration
    event Action<IItem> ItemEquipped
    Event Type
    Type Description
    Action<IItem>
    | Edit this page View Source

    ItemUnequipped

    Event invoked when an IItem was successfully unequipped. Returns the newly unequipped IItem.

    Declaration
    event Action<IItem> ItemUnequipped
    Event Type
    Type Description
    Action<IItem>
    • Edit this page
    • View Source
    In this article
    Back to top Generated by DocFX