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 answer 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:getEntityKind () | Return the kind of the entity |
_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:loaded () | Loaded, we add ourself back to the game |
_M:resolve (t, last, on_entity) | Resolves the object This will call the entities resolver and then add to the game entities list |
_M:setupMinimapInfo (mo, map) | Setup minimap color for this entity You may overload this method to customize your minimap |
_M:stack (o, force) | 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 answer 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:getEntityKind ()
- Return the kind of the entity
- _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:loaded ()
- Loaded, we add ourself back to the game
- _M:resolve (t, last, on_entity)
-
Resolves the object This will call the entities resolver and then add to the game entities list
Parameters
- t:
- last:
- on_entity:
- _M:setupMinimapInfo (mo, map)
-
Setup minimap color for this entity You may overload this method to customize your minimap
Parameters
- mo:
- map:
- _M:stack (o, force)
-
Adds object to the stack
Parameters
- o:
- force:
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