Features:
- Now you can request for system removal when it's no longer needed. Check
requestRemoval
.
Fixes:
- [Breaking Change] Arguments order of
pick
by id API aligned with other APIs. isLinkedComponent
now 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:
id
ofLinkedComponent
is not readonly anymore.
Features:
- Linked components now have an optional id, and can be picked with
pick
by 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
withdraw
removes the first LinkedComponent component of the provided type or existing standard component - Method
pick
removes provided LinkedComponent component instance or existing standard component - Method
iterate
iterates over instances of LinkedComponent and performs theaction
over each. Works for standard components (action will be called for a single instance in this case). - Method
find
searches a component instance of the specified class. Works for standard components (predicate will be called for a single instance in this case). - Method
getAll
returns a generator that can be used for iteration over all instances of specific type components. - Method
lengthOf
returns the number of existing components of the specified class.
- Method
Breaking changes:
- Signals
onComponentAdded
,onComponentRemoved
now will be triggered for every LinkedComponent. - Adding a linked component with
add
oraddComponent
will 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.current
now 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
Entity
fromEngine
by id
Breaking changes:
- Parameter
engine
was removed fromonAddedToEngine
andonRemovedFromEngine
methods in the systems. Usethis.engine
instead. EntitySnapshot
was reimplemented. It has distinguished fieldsEntitySnapshot.current and
EntitySnapshot.previous`, which reflects current and previous Entity states accordingly.Entity.components
now represented as aRecord
instead of theMap
Improvements:
- Typed-signals was replaced with the built-in light-weight implementation.
EntitySnapshot
won't be created if there are no change listeners.
Fixes:
Entity.copyFrom
now copies tags.EntitySnapshot
now works properly with the tags. Previously, the difference between the previous state and the current state did not show changes in the tags.EntitySnapshot
now 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
engine
getter 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
has
method - Documentation completely rewritten
- Removed redundant
updateEntity
fromReactionSystem
- 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#hasAll
andEntity#hasAny
- Added several utility methods for
Query
- Added
first
,last
andlength
getter for queries
- Added feature of invalidation entity and queries
- Fixed disconnecting of entities from engine
- Switched to commonjs modules
- Reverted
IterativeSystem#entities
remove - Added
IterativeSystem#prepare
protected 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
component
ofEntity#add
method - Removed redundant
entities
getter 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