EntitySelection

EntitySelection

A specialised selection object for entities

Constructor

new EntitySelection()

Methods

(static) installMethod(method, name, dependentComponent)

Installs a method that acts upon entities on the prototype of EntitySelection

Parameters:
Name Type Description
method
name
dependentComponent

and(…entities) → {EntitySelection}

Adds entities to this selection. Any resulting duplicates are removed.

Parameters:
Name Type Attributes Description
entities Entity | Array.<Entity> | EntitySelection <repeatable>

The entities to add

andSelf() → {EntitySelection}

Adds the previous selection to the current selection. Resulting duplicates are removed.

children() → {EntitySelection}

Returns the children of all entities in this selection

intersects(…entities) → {EntitySelection}

Returns the common entities between this selection and the given parameter(s)

Parameters:
Name Type Attributes Description
entities Entity | Array.<Entity> | EntitySelection <repeatable>

parent() → {EntitySelection}

Returns the parents of all entities in this selection

without(…entities) → {EntitySelection}

Removes entities from the current selection

Parameters:
Name Type Attributes Description
entities Entity | Array.<Entity> | EntitySelection <repeatable>

Entities to remove from the selection