Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Function Systems #66

Open
robertlong opened this issue Aug 27, 2019 · 1 comment
Open

Function Systems #66

robertlong opened this issue Aug 27, 2019 · 1 comment
Labels
api question Further information is requested
Projects

Comments

@robertlong
Copy link
Member

robertlong commented Aug 27, 2019

Just an idea, not sure if it's a good one yet. If systems are supposed to be stateless, it may be a good idea to make them a function.

function RotateObjectsSystem(world, queries) {
  const { dt } = queries.clock[0].getComponent(Clock);

  queries.entities.forEach((entity) => {
    
    const rotateX = entity.getComponent(RotateX);
    const transform = entity.getComponent(Transform);

    transform.rotation.x += rotate.speed * dt;
  });
}

RotateObjectsSystem.query = {
  clock: { components: [Clock]},
  entities: { components: [Transform, RotateX] }
};
@fernandojsg fernandojsg added this to Backlog in ECSY Core Aug 28, 2019
@fernandojsg fernandojsg added api question Further information is requested labels Sep 17, 2019
@wingyplus
Copy link
Contributor

Seems like React stateless component. 😆

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api question Further information is requested
Projects
ECSY Core
  
Backlog
Development

No branches or pull requests

3 participants