Table of Contents

Interface IEquipmentController

Namespace
FishMMO.Shared.Core
Assembly
FishMMO.Shared.dll

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

List<Trigger>

OnUnequipTriggers

Triggers invoked when this character unequips an item. EventData: EquipItemEventData.

List<Trigger> OnUnequipTriggers { get; }

Property Value

List<Trigger>

Methods

Activate(int)

Activates the item in the specified equipment slot, typically triggering its use effect.

void Activate(int index)

Parameters

index int

The 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

item Item

The item to equip.

inventoryIndex int

The index in the source inventory.

container IItemContainer

The source item container (e.g., inventory or bank).

toSlot ItemSlot

The 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

container IItemContainer

The destination item container.

slot byte

The equipment slot to unequip from.

modifiedItems List<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

Action<Item, ItemSlot>

OnItemUnequipped

Fired after an item is successfully unequipped. Subscribers receive the item and the slot.

event Action<Item, ItemSlot> OnItemUnequipped

Event Type

Action<Item, ItemSlot>