silphius/app/ecs/systems/run-ticking-promises.js
2024-07-20 05:07:39 -05:00

26 lines
398 B
JavaScript

import {System} from '@/ecs/index.js';
export default class RunTickingPromises extends System {
static get priority() {
return {
phase: 'pre',
};
}
static queries() {
return {
default: ['Ticking'],
};
}
tick(elapsed) {
for (const {Ticking} of this.select('default')) {
if (Ticking.isTicking) {
Ticking.tick(elapsed);
}
}
}
}