# 1.4.0

  - Added entity id reclaiming to [EntityMap](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html)
    - Destroyed entity IDs are now reused to maintain density and avoid ID exhaustion.

  - Added [entityValues](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#entityvalues) method to the [EntityMap](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html) class
    - Returns an array of all component data associated with the keyComponent
  
  - Hardened component registration and error handling
    - `ecs.register()` now throws `ComponentAlreadyRegistered` if a component is already registered.
    - `ecs.register()` now throws `ComponentTypeKeyMissing` for anonymous classes (classes with no name).
    - Standardized `has`, `hasAll`, and `hasAny` to throw `ComponentNotRegistered` when any of the specified component(s) are not registered.

  - Improved [EntityMap.parse](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#parse)
    - Correctly restores internal state including `nextId` and `freeIds`.

  - Improved code documentation

  - Improved ecs.printTable argument handling and `this` chaining

  - Added docs/cheetsheet.md to npm package

  - Added CHANGELOG.md to npm package

  - Deprecated [first](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#first) method in the [EntityMap](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html) class
    Use [firstEntity](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#firstentity) instead

# 1.3.0

  - Added [ComponentQuery](https://ecsjs.gitlab.io/ecs/classes/ComponentQuery.html) class that can be stored and reused.<br>
    - Can be created via the global entity map<br> 
      e.g. `ecs.query(Player, Position)`
    - Query functions
      - [entityCount](https://ecsjs.gitlab.io/ecs/classes/ComponentQuery.html#entitycount)
      - [firstEntry](https://ecsjs.gitlab.io/ecs/classes/ComponentQuery.html#firstentry)
      - [firstKey](https://ecsjs.gitlab.io/ecs/classes/ComponentQuery.html#firstkey)
      - [firstValue](https://ecsjs.gitlab.io/ecs/classes/ComponentQuery.html#firstvalue)
      - [entries](https://ecsjs.gitlab.io/ecs/classes/ComponentQuery.html#entries)
      - [keys](https://ecsjs.gitlab.io/ecs/classes/ComponentQuery.html#keys)
      - [values](https://ecsjs.gitlab.io/ecs/classes/ComponentQuery.html#values)

    - Can be used to [iterate](https://ecsjs.gitlab.io/ecs/classes/ComponentQuery.html#iterator) over entities related to the query

    - Can [destroyEntities](https://ecsjs.gitlab.io/ecs/classes/ComponentQuery.html#destroyentities) related to the query

  - Updated [ComponentIterator](https://ecsjs.gitlab.io/ecs/classes/ComponentIterator.html) constructor parameters to be a single [ComponentQuery](https://ecsjs.gitlab.io/ecs/classes/ComponentQuery.html) instance

  - Added ability to return all components by entity id using [get](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#get) or by component using [first](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#first)

  - Updated the ComponentClassesMap to use a dense strategy using hash keys instead of strings (interface is the same)

  - Updated ComponentMap map to use a sparse set strategy (interface is the same)

  - Added filter capability to the ecs.printTable function
    - [printTable](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#printtable)
    - [printEntity](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#printentity)

  - Fixed internal nextId not getting reset to 0 when [ecs.clear()](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#clear) or [ecs.clearComponents()](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#clearcomponents) is called

# 1.2.0

  - Updated [firstEntry](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#firstentry) to return related component data (if specified)
  - Updated [destroyEntity](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#destroyentity) to return the count of deleted entities

# 1.1.0

  - Added [hasAll](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#hasall) and [hasAny](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html#hasany) methods to the [EntityMap](https://ecsjs.gitlab.io/ecs/classes/EntityMap.html) class
  - Removed legacy subclass MapIterators from ComponentMap
  - Added a [Cheat Sheet](https://gitlab.com/ecsjs/ecs/-/blob/master/docs/cheat-sheet.md) doc