Skip to content

Do not bind systems to the entityManager instance #108

Description

@GGAlanSmithee

Since a user can pass any options in the opts param when invoking a system, there is no longer any need to bind the EntityManager instance as the this argument to registered systems.

To achieve the old behavior, a user can simply:

entityManager.registerLogicSystem(key, (entities, { entityManager }) => {
   for (const entity of entities) {
       // do something using the entityManager
   }
})

// later ...

entityManager.onLogic({ entityManager })

This will remove one of the most annoying gotchas in the current API.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions