Features:
-
Introduced possibility to safely remove entities from the engine. Now
Engine.removeEntitytakes a boolean value as a second argument "safe", which indicates whether the entity should be removed safely or not.If safe argument value is
truethen the entity will be removed after the Engine update cycle is iteration is finished, meaning that the entity will be removed after all systems have been updated.Safely removed entities won't be discoverable by getEntityById method, but they will be still accessible in the queries (and remaining systems updates).
This behavior will become default in the next major release.
Features:
- Now you can request for system removal when it's no longer needed. Check
requestRemoval.
Fixes:
- [Breaking Change] Arguments order of
pickby id API aligned with other APIs. isLinkedComponentnow returns false for undefined values, instead of throwing an Error.
Features:
- The following APIs got an additional optional id parameter to make working with Linked Components easier:
has,hasComponent,get.
Fixes:
idofLinkedComponentis not readonly anymore.
Features:
- Linked components now have an optional id, and can be picked with
pickby id.
Fixes:
- Fixed usage sample for LinkedComponents
Fixes:
- If IterativeSystem was removed from the engine and added again later, no iteration took place.
Fixes:
- ReactionSystem now exported through index.ts
Features:
- Added a new convenient API for working with linked components:
- Method
withdrawremoves the first LinkedComponent component of the provided type or existing standard component - Method
pickremoves provided LinkedComponent component instance or existing standard component - Method
iterateiterates over instances of LinkedComponent and performs theactionover each. Works for standard components (action will be called for a single instance in this case). - Method
findsearches a component instance of the specified class. Works for standard components (predicate will be called for a single instance in this case). - Method
getAllreturns a generator that can be used for iteration over all instances of specific type components. - Method
lengthOfreturns the number of existing components of the specified class.
- Method
Breaking changes:
- Signals
onComponentAdded,onComponentRemovednow will be triggered for every LinkedComponent. - Adding a linked component with
addoraddComponentwill remove all existing linked components of the same type. Linked components will be replaced even if the passed component already exists in the Entity.
Fixes:
EntitySnapshot.currentnow is writable.- Added inline documentation to
EntitySnapshot.previous.
Features:
- Added shared config entity, that is accessible across all systems added to
Engine - Added possibility to retrieve
EntityfromEngineby id
Breaking changes:
- Parameter
enginewas removed fromonAddedToEngineandonRemovedFromEnginemethods in the systems. Usethis.engineinstead. EntitySnapshotwas reimplemented. It has distinguished fieldsEntitySnapshot.current andEntitySnapshot.previous`, which reflects current and previous Entity states accordingly.Entity.componentsnow represented as aRecordinstead of theMap
Improvements:
- Typed-signals was replaced with the built-in light-weight implementation.
EntitySnapshotwon't be created if there are no change listeners.
Fixes:
Entity.copyFromnow copies tags.EntitySnapshotnow works properly with the tags. Previously, the difference between the previous state and the current state did not show changes in the tags.EntitySnapshotnow works properly with the resolveClass.
Features:
- Add linked components Fixed:
- Documentation readability
Features:
- Add possibility to set any type as the message type for subscription
- Fixed broken Class API
- Fixed broken API for QueryBuilder and Entity.remove
- Added tags support
- Added messaging channel for system->engine->user
- Fixed EntitySnapshot behavior
- Added
enginegetter in the System - Added support of initialization ReactionSystem and IterativeSystem with QueryPredicate and QueryBuilder
- Query got possibility to check whether entity is in it, via
hasmethod - Documentation completely rewritten
- Removed redundant
updateEntityfromReactionSystem
- Added
ReactionSystem - Documentation updated
- Fixed critical issue with updating of a
Query. Queries whose predicates were a set of conditions that went beyond the capabilities of QueryBuilder could incorrectly evaluate the presence state for Entity after removing or adding components.
- Fixed wrong type inference for
Entity#hasAllandEntity#hasAny - Added several utility methods for
Query
- Added
first,lastandlengthgetter for queries
- Added feature of invalidation entity and queries
- Fixed disconnecting of entities from engine
- Switched to commonjs modules
- Reverted
IterativeSystem#entitiesremove - Added
IterativeSystem#prepareprotected method, which will be invoked after adding iterative system to engine
- Added Entity#hasAny, Entity#hasAll methods
- Fixed throwing an error with passing invalid value to param
componentofEntity#addmethod - Removed redundant
entitiesgetter fromIterativeSystem
- Fixed bug with disconnecting from Entity events after remove from Engine.
- Added utility methods for clearing
Engine.Engine#clear()Engine#removeAllSystems()Engine#removeAllQueries()Engine#removeAllEntities()
- Changed logic of resolving of component identifier. Changes could affect resolving of inherited components. Now inherited components will not be resolved as its ancestors.
- Added parameter for Entity#add "resolveClass" - which specifies how could be resolved component.
- Updated documentation
- Added tests for Query#isEmpty
- Added Query#isEmpty property
- Added documentation
- Fixed query onEntityAdded, onEntityRemoved handlers
- Added entity snapshot for properly handling of the entity changes
- Fixed false-positive query trigger
- Switched library target to ES5
- Updated documentation for every core type
- Added guard that stops updating process for IterativeSystem, if it was removed engine
- Fixed order of dispatching and removing of the component. Now dispatching happens before removing.
- Added "get accessor" to query entities from Iterative system
- Initial release