refactor: wrapped system

This commit is contained in:
cha0s 2022-09-17 07:09:02 -05:00
parent 12f17641e9
commit 2ffad2d86f

View File

@ -40,14 +40,17 @@ export default class Ecs {
const ecs = this; const ecs = this;
class WrappedSystem extends System { class WrappedSystem extends System {
// eslint-disable-next-line class-methods-use-this constructor(Components) {
createEntity(components) { super(Components);
return ecs.create(components); this.ecs = ecs;
}
createEntity(components) {
return this.ecs.create(components);
} }
// eslint-disable-next-line class-methods-use-this
createManyEntities(count, components) { createManyEntities(count, components) {
return ecs.createMany(count, components); return this.ecs.createMany(count, components);
} }
} }