# Class: EntityManager

## EntityManager

#### new EntityManager()

  Manage, create, and destroy entities. Can use methods to mutate entities (tags, components) directly or via the facade on the Entity.
  Source:
    - EntityManager.js, line 12

### Members

#### _entities :Array.<Entity>

  ##### Type:

  - Array.<Entity>
  Source:
    - EntityManager.js, line 19

#### _groups :Array.<Group>

  ##### Type:

  - Array.<Group>
  Source:
    - EntityManager.js, line 24

### Methods

#### count() → {Number}

  Source:
    - EntityManager.js, line 235

  ##### Returns:

  Total number of entities.
  Type
    Number

#### createEntity() → {Entity}

  Get a new entity.
  Source:
    - EntityManager.js, line 46

  ##### Returns:

  Type
    Entity

#### entityAddComponent(entity, Component)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `entity` | Entity |
  `Component` | function |

  Source:
    - EntityManager.js, line 141

#### entityAddTag(entity, tag)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `entity` | Entity |
  `tag` | String |

  Source:
    - EntityManager.js, line 107

#### entityRemoveComponent(entity, Component)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `entity` | Entity |
  `Component` | function |

  Source:
    - EntityManager.js, line 176

#### entityRemoveTag(entity, tag)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `entity` | Entity |
  `tag` | String |

  Source:
    - EntityManager.js, line 125

#### poolStats() → {Object}

  Get information about the object pools of the entities and the various components.
  Source:
    - EntityManager.js, line 268

  ##### Returns:

  Type
    Object

#### queryComponents(Components) → {Array.<Entity>}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `Components` | Array.<function()> |

  Source:
    - EntityManager.js, line 207

  ##### Returns:

  Type
    Array.<Entity>

#### queryTag(tag) → {Array.<Entity>}

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `tag` | String |

  Source:
    - EntityManager.js, line 222

  ##### Returns:

  Type
    Array.<Entity>

#### removeEntity(entity)

  ##### Parameters:

  Name | Type | Description
  --- | --- | ---
  `entity` | Entity |

  Source:
    - EntityManager.js, line 58