refactor: wrapped system
This commit is contained in:
parent
12f17641e9
commit
2ffad2d86f
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user