new Template(template)
Represents an entity template which defines a class of game objects.
In 0AD, each object found in a game is an instance of
an entity template. The "template" is similar to a
class definition in a regular programming language.
Parameters:
template
:
Object
|
The DOM of the entity template definition
as layed down in the XML documents of the
active mods. For regular 0AD entities, the
templates are found in
/binaries/data/mods/public/simulation/templates
|
- Source:
- entity.js, line 19
| footprintRadius() → {Number} | Returns the radius of a circle surrounding this entity's footprint. |
| getResourceType() → {String} | Provides the type of resource to be gathered from this entity type. |
| isUnhuntable() → {Boolean} | Returns whether this is an animal that is too difficult to hunt. (Any non domestic currently.) |
| obstructionRadius() → {Number} | Computes the size of a circular "bounding cylinder" around the entity. |
Methods
-
footprintRadius() → {Number}
-
Returns the radius of a circle surrounding this entity's footprint.
- Source:
- entity.js, line 168
Returns:
The radius of the smallest circle the entity's footprint will fit in.- Type
- Number
-
getResourceType() → {String}
Provides the type of resource to be gathered from this entity type.
-
- Source:
- entity.js, line 375
Returns:
The name of the resource type provided by the entity emplate. Currently these are"food","metal","stone","wood"- Type
- String
-
isUnhuntable() → {Boolean}
-
Returns whether this is an animal that is too difficult to hunt. (Any non domestic currently.)
- Source:
- entity.js, line 458
Returns:
trueiff the entity will flee or counter-attack when hunted.- Type
- Boolean
-
obstructionRadius() → {Number}
Computes the size of a circular "bounding cylinder" around the entity.
-
- Source:
- entity.js, line 145
Returns:
The radius of a circle surrounding this entity's obstruction shape, or undefined if the entity does not obstruct anything.- Type
- Number