diff --git a/src/schedule/core/systembuilder.js b/src/schedule/core/systembuilder.js index 229fdbe1..d06f17e5 100644 --- a/src/schedule/core/systembuilder.js +++ b/src/schedule/core/systembuilder.js @@ -10,6 +10,12 @@ export class SchedulerBuilder { */ systems = [] + /** + * @private + * @type {SystemGroupConfig[]} + */ + systemGroups = [] + /** * @param {SystemConfig} config */ @@ -17,6 +23,13 @@ export class SchedulerBuilder { this.systems.push(config) } + /** + * @param {SystemGroupConfig} config + */ + addGroup(config) { + this.systemGroups.push(config) + } + /** * @param {Scheduler} scheduler */ @@ -32,3 +45,8 @@ export class SchedulerBuilder { } } } + +/** + * @typedef SystemGroupConfig + * @property {import('../../type/index.js').Constructor} label + */ diff --git a/src/schedule/core/systemconfig.js b/src/schedule/core/systemconfig.js index 803248a4..fc9f9ebe 100644 --- a/src/schedule/core/systemconfig.js +++ b/src/schedule/core/systemconfig.js @@ -1,6 +1,11 @@ /** @import {SystemFunc} from "../../ecs/index.js" */ export class SystemConfig { + /** + * @type {import("../../type/index.js").Constructor | undefined} + */ + systemGroup + /** * @type {SystemFunc} */ @@ -14,9 +19,11 @@ export class SystemConfig { /** * @param {SystemFunc} system * @param {string} schedule + * @param {import("../../type/index.js").Constructor | undefined} [systemGroup] */ - constructor(system, schedule) { + constructor(system, schedule, systemGroup) { this.system = system this.schedule = schedule + this.systemGroup = systemGroup } }