This repository has been archived by the owner on Dec 23, 2022. It is now read-only.
This Release adds more query operations, namely:
And(...)
Or(...)
Not(...)
- This one existed before, but now accepts multiple argumentsXor(...)
These can be used like this:
import { System, Or } from "nopun-ecs";
class CollisionSystem extends System {
static queries = {
npcs: [CollisionShape, Or(Friend, Enemy)],
player: [CollisionShape, Player]
};
}
Additionally, this Release adds two new Methods to entities:
entity.put(CC: ComponentConstructor, value?: object): Entity
This method adds the given component if it has not been added before, otherwise it updates it.
entity.take(...CCs: ComponentConstructor[]): Generator<C[]>
This method will check for the existence of multiple components and will only yield a result, if all components are present.