Class: API3.Filters

[No frames]

new Filters()

A class-factory for entity-collections using filters.

Source:
Method summary
.byClass(cls) → {API3.Filter} Creates a filtering by class tag.
.byType(type) → {API3.Filter} Creates a filtering by entity type (template).

Methods

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:
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

byType(type) → {API3.Filter}

Creates a filtering by entity type (template).

Parameters:
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