-
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.
-
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.
Other members:
Inherited from
Component:applyDiff(),checkRequirements(),clone(),diff(),getBase(),getRequirements(),owner,requirementsInherited from
Object:_serializationBlacklist,adopt(),assertType(),className,deepcopy(),deserialize(),extend(),instanceOf(),is(),isInstance(),mixin(),prettyprint(),serializationBlacklist,serialize()-
slots: