Interface IEquipmentController
Interface for equipment controllers, managing equip/unequip logic and activation of equipment slots. Extends character behaviour and item container functionality.
public interface IEquipmentController : ICharacterBehaviour, IItemContainer
- Inherited Members
Properties
OnEquipTriggers
Triggers invoked when this character equips an item. EventData: EquipItemEventData.
List<Trigger> OnEquipTriggers { get; }
Property Value
OnUnequipTriggers
Triggers invoked when this character unequips an item. EventData: EquipItemEventData.
List<Trigger> OnUnequipTriggers { get; }
Property Value
Methods
Activate(int)
Activates the item in the specified equipment slot, typically triggering its use effect.
void Activate(int index)
Parameters
indexintThe equipment slot index to activate.
Equip(Item, int, IItemContainer, ItemSlot)
Equips the specified item into the given equipment slot, handling swaps and unequips as needed.
bool Equip(Item item, int inventoryIndex, IItemContainer container, ItemSlot toSlot)
Parameters
itemItemThe item to equip.
inventoryIndexintThe index in the source inventory.
containerIItemContainerThe source item container (e.g., inventory or bank).
toSlotItemSlotThe equipment slot to equip the item into.
Returns
- bool
True if the item was successfully equipped, false otherwise.
Unequip(IItemContainer, byte, out List<Item>)
Unequips the item from the specified slot and adds it to the given container (e.g., inventory or bank).
bool Unequip(IItemContainer container, byte slot, out List<Item> modifiedItems)
Parameters
containerIItemContainerThe destination item container.
slotbyteThe equipment slot to unequip from.
modifiedItemsList<Item>The list of items modified during the operation.
Returns
- bool
True if the item was successfully unequipped and added, false otherwise.
Events
OnItemEquipped
Fired after an item is successfully equipped. Subscribers receive the item and the slot.
event Action<Item, ItemSlot> OnItemEquipped
Event Type
OnItemUnequipped
Fired after an item is successfully unequipped. Subscribers receive the item and the slot.
event Action<Item, ItemSlot> OnItemUnequipped