-
class Item:
Component
¶ Indicates that an actor can be held in an
Inventory
.-
stackCount:
integer
¶
-
stacklimit:
unknown
¶
-
__new(
self:Item
,
options: {weight:number
, volume:number
, stackable: (boolean
| fun(...any
):Actor
)?, stackLimit:number
|nil
}
)¶ Constructor for the Item component, see ItemOptions for available options.
-
stackLimit:
number
¶
-
stack(self:
Item
, actor:Actor
)¶ Stacks an actor into this item. Updates the stackCount of both this item and the input item.
-
split(self:
Item
, count:integer
): (split:Actor
)¶ Splits the stack, constructing a new actor with the correct count and returning it. Returns its owner if count is 1 and the item is not stackable.
-
getWeight(self:
Item
): (weight:number
)¶ Gets the total weight of this item taking into account its stackCount.
-
getVolume(self:
Item
): (volume:number
)¶ Gets the total volume of this item taking into account its stackCount.
Other members:
Inherited from
Component
:checkRequirements()
,getBase()
,getRequirements()
,owner
,requirements
Inherited from
Object
:_serializationBlacklist
,adopt()
,assertType()
,className
,deserialize()
,extend()
,instanceOf()
,is()
,isInstance()
,mixin()
,prettyprint()
,serializationBlacklist
,serialize()
-
stackCount: