Constructor
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:
| Name | Type | Description |
|---|---|---|
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 |
Methods
footprintRadius() → {Number}
Returns the radius of a circle surrounding this entity's
footprint.
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.
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.)
Returns:
true iff the entity will flee or
counter-attack when hunted.
- Type
- Boolean
obstructionRadius() → {Number}
Computes the size of a circular "bounding cylinder" around the entity.
Returns:
The radius of a circle surrounding this entity's
obstruction shape, or undefined if the entity does
not obstruct anything.
- Type
- Number