Constructor
new Filters()
A class-factory for entity-collections using filters.
- Source:
Methods
(static) byClass(cls) → {API3.Filter}
Creates a filtering by class tag.
A class tag is an identifier which describes a
category of entities. These tags are defined at the
template level and cannot be
changed by the AI.
Parameters:
| Name | Type | Description |
|---|---|---|
cls |
String | The name of an entity class to match, e.g.
"worker" |
- Source:
Returns:
A filter object which selects only those
entities belonging to the specified
class.
- Type
- API3.Filter
(static) byType(type) → {API3.Filter}
Creates a filtering by entity type (template).
Parameters:
| Name | Type | Description |
|---|---|---|
type |
String | The instantiated name of an entity
template, e.g.
"units/viking_longboat". |
- Source:
Returns:
A filter object which selects entities of
the specified template type.
- Type
- API3.Filter