Module engine.Object

Functions

_M:act () Do something when its your turn For objects this mostly is to recharge them By default, does nothing at all
_M:canAct () Can this object act at all Most object will want to anwser false, only recharging and stuff needs them
_M:canStack (o) Can it stacks with others of its kind ?
_M:enoughEnergy (val) Do we have enough energy
_M:forAllStack (fct) Applies a function to all items of the stack
_M:getDesc () Gets the full desc of the object
_M:getDisplayColor () Gets the color in which to display the object in lists
_M:getName (t) Gets the full name of the object
_M:getNumber () Returns the number of objects available Always one for non stacking objects
_M:getRequirementDesc (who) Describe requirements
_M:getSubtypeOrder () Sorting by type function By default, sort by subtype name
_M:getTypeOrder () Sorting by type function By default, sort by type name
_M:resolve (t, last) Resolves the object This will call the entities resolver and then add to the game entities list
_M:stack (o) Adds object to the stack
_M:stackable () Stackable, can it stack at all ?
_M:unstack () Removes an object of the stack
_M:useEnergy (val) Use some energy
_M:wornInven () Returns the inventory type an object is worn on


Functions

_M:act ()
Do something when its your turn For objects this mostly is to recharge them By default, does nothing at all
_M:canAct ()
Can this object act at all Most object will want to anwser false, only recharging and stuff needs them
_M:canStack (o)
Can it stacks with others of its kind ?

Parameters

  • o:
_M:enoughEnergy (val)
Do we have enough energy

Parameters

  • val:
_M:forAllStack (fct)
Applies a function to all items of the stack

Parameters

  • fct:
_M:getDesc ()
Gets the full desc of the object
_M:getDisplayColor ()
Gets the color in which to display the object in lists
_M:getName (t)
Gets the full name of the object

Parameters

  • t:
_M:getNumber ()
Returns the number of objects available Always one for non stacking objects
_M:getRequirementDesc (who)
Describe requirements

Parameters

  • who:
_M:getSubtypeOrder ()
Sorting by type function By default, sort by subtype name
_M:getTypeOrder ()
Sorting by type function By default, sort by type name
_M:resolve (t, last)
Resolves the object This will call the entities resolver and then add to the game entities list

Parameters

  • t:
  • last:
_M:stack (o)
Adds object to the stack

Parameters

  • o:

Return value:

true if stacking worked, false if not
_M:stackable ()
Stackable, can it stack at all ?
_M:unstack ()
Removes an object of the stack

Return value:

object, true if the last, or object, false if more
_M:useEnergy (val)
Use some energy

Parameters

  • val:
_M:wornInven ()
Returns the inventory type an object is worn on

Valid XHTML 1.0!