Table of Contents

Class ItemEquippable

Namespace
FishMMO.Shared
Assembly
FishMMO.Shared.dll

Represents the equippable component of an item, handling equip/unequip logic and owner tracking. Manages events for when the item is equipped or unequipped by a character.

public class ItemEquippable : IEquippable<ICharacter>
Inheritance
ItemEquippable
Implements
Inherited Members

Properties

Character

The character currently owning/equipping this item. Null if not equipped.

public ICharacter Character { get; }

Property Value

ICharacter

Methods

Destroy()

Destroys the equippable component, ensuring it is unequipped and cleaned up.

public void Destroy()

Equip(ICharacter)

Equips the item to the specified character, firing the OnEquip event. If already equipped, unequips first.

public void Equip(ICharacter owner)

Parameters

owner ICharacter

The character to equip the item to.

Initialize(Item)

Initializes the equippable component with its parent item.

public void Initialize(Item item)

Parameters

item Item

The item instance.

Unequip()

Unequips the item from the current character, firing the OnUnequip event.

public void Unequip()

Events

OnEquip

Event triggered when the item is equipped by a character.

public event Action<ICharacter> OnEquip

Event Type

Action<ICharacter>

OnUnequip

Event triggered when the item is unequipped by a character.

public event Action<ICharacter> OnUnequip

Event Type

Action<ICharacter>