class EquipmentSlot
name: string
label: string
category: string
class Equipper: Component

Handles equipping and tracking of Equipment components on an Actor. Maintains available slots, equipped items, and their conditions.

slots: EquipmentSlot[]
equipped: table<string, Actor?>

The list of currently equipped actors representing equipment items.

statusMap: table<Actor, integer>

Maps equipped actors to their applied status handles for easy removal.

__new(
    self: Equipper,
    slots: (string | {name: string, label: string, category: string})[]
)
Parameters:

slots ((string | {name: string, label: string, category: string})[]) – List of available slot names.

canEquip(self: Equipper, equipment: Actor | Equipment): boolean

Checks if the given equipment can be equipped with current available slots.

Parameters:

equipment (Actor | Equipment) – The equipment to test.

Returns:

_1 (boolean) – True if the equipment can be equipped, false otherwise.

get(self: Equipper, slot: string): Actor?

Gets the actor equipped in the slot, or nil if it’s empty.

isEquipped(self: Equipper, actor: Actor): (True: boolean)

Checks whether the given actor is currently equipped.

Parameters:

actor (Actor) – The equipment actor to check.

Returns:

True (boolean) – if equipped, false otherwise.