iris-ecs 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +70 -36
- package/dist/component.d.ts.map +1 -1
- package/dist/component.js +5 -5
- package/dist/component.js.map +1 -1
- package/dist/entity.d.ts +3 -3
- package/dist/entity.d.ts.map +1 -1
- package/dist/entity.js +7 -8
- package/dist/entity.js.map +1 -1
- package/dist/event.d.ts +19 -20
- package/dist/event.d.ts.map +1 -1
- package/dist/event.js +91 -65
- package/dist/event.js.map +1 -1
- package/dist/filters.d.ts.map +1 -1
- package/dist/filters.js +7 -6
- package/dist/filters.js.map +1 -1
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/dist/query.d.ts +2 -11
- package/dist/query.d.ts.map +1 -1
- package/dist/query.js +8 -13
- package/dist/query.js.map +1 -1
- package/dist/relation.js +2 -2
- package/dist/relation.js.map +1 -1
- package/dist/scheduler.d.ts +129 -27
- package/dist/scheduler.d.ts.map +1 -1
- package/dist/scheduler.js +255 -59
- package/dist/scheduler.js.map +1 -1
- package/dist/world.d.ts +33 -9
- package/dist/world.d.ts.map +1 -1
- package/dist/world.js +20 -6
- package/dist/world.js.map +1 -1
- package/package.json +1 -1
package/dist/scheduler.d.ts
CHANGED
|
@@ -1,10 +1,69 @@
|
|
|
1
1
|
import type { World } from "./world.js";
|
|
2
2
|
/**
|
|
3
|
-
* Schedule
|
|
3
|
+
* Schedule label brand for nominal typing.
|
|
4
|
+
*/
|
|
5
|
+
declare const SCHEDULE_LABEL_BRAND: unique symbol;
|
|
6
|
+
/**
|
|
7
|
+
* Schedule label (branded string).
|
|
8
|
+
*
|
|
9
|
+
* Identifies a schedule within the pipeline. Built-in labels are provided
|
|
10
|
+
* for common lifecycle stages, custom labels created via defineSchedule().
|
|
11
|
+
*/
|
|
12
|
+
export type ScheduleLabel = string & {
|
|
13
|
+
[SCHEDULE_LABEL_BRAND]: true;
|
|
14
|
+
};
|
|
15
|
+
/**
|
|
16
|
+
* Define a custom schedule label.
|
|
17
|
+
*
|
|
18
|
+
* @param name - Schedule name (must be unique when inserted into pipeline)
|
|
19
|
+
* @returns Schedule label
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```typescript
|
|
23
|
+
* const Physics = defineSchedule("Physics");
|
|
24
|
+
* insertScheduleAfter(world, Physics, PreUpdate);
|
|
25
|
+
* addSystem(world, gravitySystem, { schedule: Physics });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
export declare function defineSchedule(name: string): ScheduleLabel;
|
|
29
|
+
/**
|
|
30
|
+
* Startup schedule. Runs once before the first frame.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Startup: ScheduleLabel;
|
|
33
|
+
/**
|
|
34
|
+
* Shutdown schedule. Runs once when stop() is called.
|
|
35
|
+
*/
|
|
36
|
+
export declare const Shutdown: ScheduleLabel;
|
|
37
|
+
/**
|
|
38
|
+
* First schedule in the main loop. Runs every frame before PreUpdate.
|
|
4
39
|
*
|
|
5
|
-
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```typescript
|
|
42
|
+
* addSystem(world, inputSystem, { schedule: First });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare const First: ScheduleLabel;
|
|
46
|
+
/**
|
|
47
|
+
* Pre-update schedule. Runs every frame before Update.
|
|
48
|
+
*/
|
|
49
|
+
export declare const PreUpdate: ScheduleLabel;
|
|
50
|
+
/**
|
|
51
|
+
* Update schedule. Default schedule for systems. Runs every frame.
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```typescript
|
|
55
|
+
* addSystem(world, physicsSystem); // defaults to Update
|
|
56
|
+
* ```
|
|
6
57
|
*/
|
|
7
|
-
export
|
|
58
|
+
export declare const Update: ScheduleLabel;
|
|
59
|
+
/**
|
|
60
|
+
* Post-update schedule. Runs every frame after Update.
|
|
61
|
+
*/
|
|
62
|
+
export declare const PostUpdate: ScheduleLabel;
|
|
63
|
+
/**
|
|
64
|
+
* Last schedule in the main loop. Runs every frame after PostUpdate.
|
|
65
|
+
*/
|
|
66
|
+
export declare const Last: ScheduleLabel;
|
|
8
67
|
/**
|
|
9
68
|
* System function signature.
|
|
10
69
|
*
|
|
@@ -20,9 +79,9 @@ export type SystemOptions = {
|
|
|
20
79
|
*/
|
|
21
80
|
name?: string;
|
|
22
81
|
/**
|
|
23
|
-
* Schedule this system belongs to. Defaults to
|
|
82
|
+
* Schedule this system belongs to. Defaults to Update.
|
|
24
83
|
*/
|
|
25
|
-
schedule?:
|
|
84
|
+
schedule?: ScheduleLabel;
|
|
26
85
|
/**
|
|
27
86
|
* Run before these systems (within same schedule).
|
|
28
87
|
*/
|
|
@@ -43,7 +102,7 @@ export type SystemMeta = {
|
|
|
43
102
|
/**
|
|
44
103
|
* Schedule this system belongs to.
|
|
45
104
|
*/
|
|
46
|
-
schedule:
|
|
105
|
+
schedule: ScheduleLabel;
|
|
47
106
|
/**
|
|
48
107
|
* Registration order (for stable sort).
|
|
49
108
|
*/
|
|
@@ -63,44 +122,87 @@ export type SystemMeta = {
|
|
|
63
122
|
* @param world - World instance
|
|
64
123
|
* @param runner - System function (must be named unless name option provided)
|
|
65
124
|
* @param options - Registration options (name, schedule, before, after)
|
|
66
|
-
*
|
|
125
|
+
*
|
|
67
126
|
* @example
|
|
127
|
+
* ```typescript
|
|
68
128
|
* addSystem(world, physicsSystem);
|
|
69
|
-
* addSystem(world, renderSystem, { after: "physicsSystem" });
|
|
129
|
+
* addSystem(world, renderSystem, { schedule: PostUpdate, after: "physicsSystem" });
|
|
130
|
+
* ```
|
|
70
131
|
*/
|
|
71
132
|
export declare function addSystem(world: World, runner: SystemRunner, options?: SystemOptions): void;
|
|
72
133
|
/**
|
|
73
|
-
*
|
|
74
|
-
*
|
|
134
|
+
* Insert a schedule before an existing schedule in the pipeline.
|
|
135
|
+
*
|
|
136
|
+
* @param world - World instance
|
|
137
|
+
* @param schedule - New schedule label to insert
|
|
138
|
+
* @param anchor - Existing schedule label to insert before
|
|
139
|
+
*
|
|
140
|
+
* @example
|
|
141
|
+
* ```typescript
|
|
142
|
+
* const Physics = defineSchedule("Physics");
|
|
143
|
+
* insertScheduleBefore(world, Physics, Update);
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
146
|
+
export declare function insertScheduleBefore(world: World, schedule: ScheduleLabel, anchor: ScheduleLabel): void;
|
|
147
|
+
/**
|
|
148
|
+
* Insert a schedule after an existing schedule in the pipeline.
|
|
75
149
|
*
|
|
76
150
|
* @param world - World instance
|
|
77
|
-
* @param
|
|
78
|
-
* @
|
|
151
|
+
* @param schedule - New schedule label to insert
|
|
152
|
+
* @param anchor - Existing schedule label to insert after
|
|
153
|
+
*
|
|
79
154
|
* @example
|
|
80
|
-
*
|
|
81
|
-
*
|
|
155
|
+
* ```typescript
|
|
156
|
+
* const Render = defineSchedule("Render");
|
|
157
|
+
* insertScheduleAfter(world, Render, PostUpdate);
|
|
158
|
+
* ```
|
|
82
159
|
*/
|
|
83
|
-
export declare function
|
|
160
|
+
export declare function insertScheduleAfter(world: World, schedule: ScheduleLabel, anchor: ScheduleLabel): void;
|
|
84
161
|
/**
|
|
85
|
-
*
|
|
162
|
+
* Execute one frame. Runs startup on first call, then all pipeline schedules,
|
|
163
|
+
* then flushes events.
|
|
86
164
|
*
|
|
87
165
|
* @param world - World instance
|
|
88
|
-
* @
|
|
89
|
-
*
|
|
166
|
+
* @returns Promise that resolves when the frame completes
|
|
167
|
+
*
|
|
90
168
|
* @example
|
|
91
|
-
*
|
|
92
|
-
*
|
|
169
|
+
* ```typescript
|
|
170
|
+
* // Game loop
|
|
171
|
+
* await runOnce(world);
|
|
172
|
+
* ```
|
|
93
173
|
*/
|
|
94
|
-
export declare function
|
|
174
|
+
export declare function runOnce(world: World): Promise<void>;
|
|
95
175
|
/**
|
|
96
|
-
*
|
|
176
|
+
* Start the main loop using requestAnimationFrame.
|
|
177
|
+
*
|
|
178
|
+
* Startup schedule runs automatically on first frame. Each frame executes
|
|
179
|
+
* all pipeline schedules in order. Call stop() to end the loop.
|
|
97
180
|
*
|
|
98
181
|
* @param world - World instance
|
|
99
|
-
*
|
|
100
|
-
* @
|
|
182
|
+
*
|
|
183
|
+
* @example
|
|
184
|
+
* ```typescript
|
|
185
|
+
* addSystem(world, physicsSystem);
|
|
186
|
+
* addSystem(world, renderSystem, { schedule: PostUpdate });
|
|
187
|
+
* run(world);
|
|
188
|
+
* // ... later
|
|
189
|
+
* await stop(world);
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
export declare function run(world: World): void;
|
|
193
|
+
/**
|
|
194
|
+
* Stop the main loop and run the shutdown schedule.
|
|
195
|
+
*
|
|
196
|
+
* @param world - World instance
|
|
197
|
+
* @returns Promise that resolves when shutdown completes
|
|
198
|
+
*
|
|
101
199
|
* @example
|
|
102
|
-
*
|
|
103
|
-
*
|
|
200
|
+
* ```typescript
|
|
201
|
+
* run(world);
|
|
202
|
+
* // ... later
|
|
203
|
+
* await stop(world);
|
|
204
|
+
* ```
|
|
104
205
|
*/
|
|
105
|
-
export declare function
|
|
206
|
+
export declare function stop(world: World): Promise<void>;
|
|
207
|
+
export {};
|
|
106
208
|
//# sourceMappingURL=scheduler.d.ts.map
|
package/dist/scheduler.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../src/scheduler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scheduler.d.ts","sourceRoot":"","sources":["../src/scheduler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AAMxC;;GAEG;AACH,OAAO,CAAC,MAAM,oBAAoB,EAAE,OAAO,MAAM,CAAC;AAElD;;;;;GAKG;AACH,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG;IAAE,CAA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AAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,EAAE,OAAO,CAAC,EAAE,aAAa,GAAG,IAAI,CAyB3F;AAMD;;;;;;;;;;;;GAYG;AACH,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAavG;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,GAAG,IAAI,CAatG;AAoLD;;;;;;;;;;;;GAYG;AACH,wBAAsB,OAAO,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBzD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,GAAG,CAAC,KAAK,EAAE,KAAK,GAAG,IAAI,CAOtC;AAyBD;;;;;;;;;;;;GAYG;AACH,wBAAsB,IAAI,CAAC,KAAK,EAAE,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,CAkBtD"}
|
package/dist/scheduler.js
CHANGED
|
@@ -1,13 +1,79 @@
|
|
|
1
|
+
import { flushEvents } from "./event.js";
|
|
2
|
+
// ============================================================================
|
|
3
|
+
// Schedule Definition
|
|
4
|
+
// ============================================================================
|
|
5
|
+
/**
|
|
6
|
+
* Define a custom schedule label.
|
|
7
|
+
*
|
|
8
|
+
* @param name - Schedule name (must be unique when inserted into pipeline)
|
|
9
|
+
* @returns Schedule label
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```typescript
|
|
13
|
+
* const Physics = defineSchedule("Physics");
|
|
14
|
+
* insertScheduleAfter(world, Physics, PreUpdate);
|
|
15
|
+
* addSystem(world, gravitySystem, { schedule: Physics });
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export function defineSchedule(name) {
|
|
19
|
+
return name;
|
|
20
|
+
}
|
|
21
|
+
// ============================================================================
|
|
22
|
+
// Built-in Schedule Labels
|
|
23
|
+
// ============================================================================
|
|
24
|
+
/**
|
|
25
|
+
* Startup schedule. Runs once before the first frame.
|
|
26
|
+
*/
|
|
27
|
+
export const Startup = defineSchedule("Startup");
|
|
28
|
+
/**
|
|
29
|
+
* Shutdown schedule. Runs once when stop() is called.
|
|
30
|
+
*/
|
|
31
|
+
export const Shutdown = defineSchedule("Shutdown");
|
|
32
|
+
/**
|
|
33
|
+
* First schedule in the main loop. Runs every frame before PreUpdate.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```typescript
|
|
37
|
+
* addSystem(world, inputSystem, { schedule: First });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export const First = defineSchedule("First");
|
|
41
|
+
/**
|
|
42
|
+
* Pre-update schedule. Runs every frame before Update.
|
|
43
|
+
*/
|
|
44
|
+
export const PreUpdate = defineSchedule("PreUpdate");
|
|
45
|
+
/**
|
|
46
|
+
* Update schedule. Default schedule for systems. Runs every frame.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* addSystem(world, physicsSystem); // defaults to Update
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
export const Update = defineSchedule("Update");
|
|
54
|
+
/**
|
|
55
|
+
* Post-update schedule. Runs every frame after Update.
|
|
56
|
+
*/
|
|
57
|
+
export const PostUpdate = defineSchedule("PostUpdate");
|
|
58
|
+
/**
|
|
59
|
+
* Last schedule in the main loop. Runs every frame after PostUpdate.
|
|
60
|
+
*/
|
|
61
|
+
export const Last = defineSchedule("Last");
|
|
62
|
+
// ============================================================================
|
|
63
|
+
// System Registration
|
|
64
|
+
// ============================================================================
|
|
1
65
|
/**
|
|
2
66
|
* Registers a system in the world for later scheduling.
|
|
3
67
|
*
|
|
4
68
|
* @param world - World instance
|
|
5
69
|
* @param runner - System function (must be named unless name option provided)
|
|
6
70
|
* @param options - Registration options (name, schedule, before, after)
|
|
7
|
-
*
|
|
71
|
+
*
|
|
8
72
|
* @example
|
|
73
|
+
* ```typescript
|
|
9
74
|
* addSystem(world, physicsSystem);
|
|
10
|
-
* addSystem(world, renderSystem, { after: "physicsSystem" });
|
|
75
|
+
* addSystem(world, renderSystem, { schedule: PostUpdate, after: "physicsSystem" });
|
|
76
|
+
* ```
|
|
11
77
|
*/
|
|
12
78
|
export function addSystem(world, runner, options) {
|
|
13
79
|
// Derive system name from function name or explicit option
|
|
@@ -23,33 +89,81 @@ export function addSystem(world, runner, options) {
|
|
|
23
89
|
const after = options?.after;
|
|
24
90
|
world.systems.byId.set(name, {
|
|
25
91
|
runner,
|
|
26
|
-
schedule: options?.schedule ??
|
|
92
|
+
schedule: options?.schedule ?? Update,
|
|
27
93
|
index: world.systems.nextIndex++,
|
|
28
94
|
before: !before ? [] : Array.isArray(before) ? before : [before],
|
|
29
95
|
after: !after ? [] : Array.isArray(after) ? after : [after],
|
|
30
96
|
});
|
|
97
|
+
world.schedules.dirty = true;
|
|
31
98
|
}
|
|
99
|
+
// ============================================================================
|
|
100
|
+
// Pipeline Management
|
|
101
|
+
// ============================================================================
|
|
32
102
|
/**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
103
|
+
* Insert a schedule before an existing schedule in the pipeline.
|
|
104
|
+
*
|
|
105
|
+
* @param world - World instance
|
|
106
|
+
* @param schedule - New schedule label to insert
|
|
107
|
+
* @param anchor - Existing schedule label to insert before
|
|
108
|
+
*
|
|
109
|
+
* @example
|
|
110
|
+
* ```typescript
|
|
111
|
+
* const Physics = defineSchedule("Physics");
|
|
112
|
+
* insertScheduleBefore(world, Physics, Update);
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
export function insertScheduleBefore(world, schedule, anchor) {
|
|
116
|
+
const idx = world.schedules.pipeline.indexOf(anchor);
|
|
117
|
+
if (idx === -1) {
|
|
118
|
+
throw new Error(`Schedule "${anchor}" not found in pipeline`);
|
|
119
|
+
}
|
|
120
|
+
if (world.schedules.pipeline.includes(schedule)) {
|
|
121
|
+
throw new Error(`Schedule "${schedule}" already in pipeline`);
|
|
122
|
+
}
|
|
123
|
+
world.schedules.pipeline.splice(idx, 0, schedule);
|
|
124
|
+
world.schedules.dirty = true;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Insert a schedule after an existing schedule in the pipeline.
|
|
35
128
|
*
|
|
36
129
|
* @param world - World instance
|
|
37
|
-
* @param
|
|
38
|
-
* @
|
|
130
|
+
* @param schedule - New schedule label to insert
|
|
131
|
+
* @param anchor - Existing schedule label to insert after
|
|
132
|
+
*
|
|
39
133
|
* @example
|
|
40
|
-
*
|
|
41
|
-
*
|
|
134
|
+
* ```typescript
|
|
135
|
+
* const Render = defineSchedule("Render");
|
|
136
|
+
* insertScheduleAfter(world, Render, PostUpdate);
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
export function insertScheduleAfter(world, schedule, anchor) {
|
|
140
|
+
const idx = world.schedules.pipeline.indexOf(anchor);
|
|
141
|
+
if (idx === -1) {
|
|
142
|
+
throw new Error(`Schedule "${anchor}" not found in pipeline`);
|
|
143
|
+
}
|
|
144
|
+
if (world.schedules.pipeline.includes(schedule)) {
|
|
145
|
+
throw new Error(`Schedule "${schedule}" already in pipeline`);
|
|
146
|
+
}
|
|
147
|
+
world.schedules.pipeline.splice(idx + 1, 0, schedule);
|
|
148
|
+
world.schedules.dirty = true;
|
|
149
|
+
}
|
|
150
|
+
// ============================================================================
|
|
151
|
+
// Schedule Building (Internal)
|
|
152
|
+
// ============================================================================
|
|
153
|
+
/**
|
|
154
|
+
* Builds an execution order from registered systems using topological sort.
|
|
155
|
+
* Systems are ordered by before/after constraints, with registration order as tiebreaker.
|
|
42
156
|
*/
|
|
43
|
-
|
|
157
|
+
function buildSchedule(world, scheduleLabel) {
|
|
44
158
|
// Filter systems belonging to this schedule
|
|
45
159
|
const scheduleSystems = new Map();
|
|
46
160
|
for (const [name, meta] of world.systems.byId) {
|
|
47
|
-
if (meta.schedule ===
|
|
161
|
+
if (meta.schedule === scheduleLabel) {
|
|
48
162
|
scheduleSystems.set(name, meta);
|
|
49
163
|
}
|
|
50
164
|
}
|
|
51
165
|
if (scheduleSystems.size === 0) {
|
|
52
|
-
world.schedules.byId.set(
|
|
166
|
+
world.schedules.byId.set(scheduleLabel, []);
|
|
53
167
|
return;
|
|
54
168
|
}
|
|
55
169
|
// Build dependency graph for Kahn's algorithm
|
|
@@ -63,7 +177,7 @@ export function buildSchedule(world, scheduleId = "runtime") {
|
|
|
63
177
|
for (const [name, meta] of scheduleSystems) {
|
|
64
178
|
for (const beforeName of meta.before) {
|
|
65
179
|
if (!scheduleSystems.has(beforeName)) {
|
|
66
|
-
throw new Error(`System "${name}" references unknown system "${beforeName}" in schedule "${
|
|
180
|
+
throw new Error(`System "${name}" references unknown system "${beforeName}" in schedule "${scheduleLabel}"`);
|
|
67
181
|
}
|
|
68
182
|
// "A before B" means edge A -> B (A must run first)
|
|
69
183
|
adjacency.get(name).push(beforeName);
|
|
@@ -71,7 +185,7 @@ export function buildSchedule(world, scheduleId = "runtime") {
|
|
|
71
185
|
}
|
|
72
186
|
for (const afterName of meta.after) {
|
|
73
187
|
if (!scheduleSystems.has(afterName)) {
|
|
74
|
-
throw new Error(`System "${name}" references unknown system "${afterName}" in schedule "${
|
|
188
|
+
throw new Error(`System "${name}" references unknown system "${afterName}" in schedule "${scheduleLabel}"`);
|
|
75
189
|
}
|
|
76
190
|
// "A after B" means edge B -> A (B must run first)
|
|
77
191
|
adjacency.get(afterName).push(name);
|
|
@@ -106,9 +220,9 @@ export function buildSchedule(world, scheduleId = "runtime") {
|
|
|
106
220
|
remaining.push(name);
|
|
107
221
|
}
|
|
108
222
|
}
|
|
109
|
-
throw new Error(`Circular dependency in schedule "${
|
|
223
|
+
throw new Error(`Circular dependency in schedule "${scheduleLabel}": ${remaining.join(", ")}`);
|
|
110
224
|
}
|
|
111
|
-
world.schedules.byId.set(
|
|
225
|
+
world.schedules.byId.set(scheduleLabel, result);
|
|
112
226
|
}
|
|
113
227
|
/**
|
|
114
228
|
* Inserts a system name into the queue maintaining sorted order by registration index.
|
|
@@ -132,73 +246,155 @@ function insertSorted(queue, name, systems) {
|
|
|
132
246
|
queue.splice(low, 0, name);
|
|
133
247
|
}
|
|
134
248
|
/**
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* @param world - World instance
|
|
138
|
-
* @param scheduleId - Schedule identifier (defaults to "runtime")
|
|
139
|
-
* @returns void
|
|
140
|
-
* @example
|
|
141
|
-
* executeSchedule(world);
|
|
142
|
-
* executeSchedule(world, "startup");
|
|
249
|
+
* Rebuilds all schedules in the pipeline plus Startup and Shutdown.
|
|
143
250
|
*/
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
251
|
+
function rebuildPipeline(world) {
|
|
252
|
+
// Build Startup and Shutdown schedules
|
|
253
|
+
buildSchedule(world, Startup);
|
|
254
|
+
buildSchedule(world, Shutdown);
|
|
255
|
+
// Build all pipeline schedules
|
|
256
|
+
for (let i = 0; i < world.schedules.pipeline.length; i++) {
|
|
257
|
+
buildSchedule(world, world.schedules.pipeline[i]);
|
|
258
|
+
}
|
|
259
|
+
world.schedules.dirty = false;
|
|
260
|
+
}
|
|
261
|
+
// ============================================================================
|
|
262
|
+
// Schedule Execution (Internal)
|
|
263
|
+
// ============================================================================
|
|
264
|
+
/**
|
|
265
|
+
* Executes a single schedule. Awaits async systems.
|
|
266
|
+
*/
|
|
267
|
+
async function executeSchedule(world, scheduleLabel) {
|
|
268
|
+
const order = world.schedules.byId.get(scheduleLabel);
|
|
269
|
+
if (!order || order.length === 0) {
|
|
270
|
+
return;
|
|
148
271
|
}
|
|
149
272
|
// Track execution context for systems that need to know their environment
|
|
150
|
-
world.execution.
|
|
151
|
-
world.execution.tick++;
|
|
273
|
+
world.execution.scheduleLabel = scheduleLabel;
|
|
152
274
|
try {
|
|
153
275
|
for (const systemId of order) {
|
|
276
|
+
world.execution.tick++;
|
|
154
277
|
world.execution.systemId = systemId;
|
|
155
278
|
const meta = world.systems.byId.get(systemId);
|
|
156
279
|
const result = meta.runner(world);
|
|
157
|
-
//
|
|
280
|
+
// Await async systems, sync systems pass through unchanged
|
|
158
281
|
if (result instanceof Promise) {
|
|
159
|
-
|
|
282
|
+
await result;
|
|
160
283
|
}
|
|
161
284
|
}
|
|
162
285
|
}
|
|
163
286
|
finally {
|
|
164
|
-
|
|
165
|
-
world.execution.
|
|
287
|
+
world.execution.tick++;
|
|
288
|
+
world.execution.scheduleLabel = null;
|
|
166
289
|
world.execution.systemId = null;
|
|
167
290
|
}
|
|
168
291
|
}
|
|
292
|
+
// ============================================================================
|
|
293
|
+
// Public Execution API
|
|
294
|
+
// ============================================================================
|
|
169
295
|
/**
|
|
170
|
-
*
|
|
296
|
+
* Execute one frame. Runs startup on first call, then all pipeline schedules,
|
|
297
|
+
* then flushes events.
|
|
171
298
|
*
|
|
172
299
|
* @param world - World instance
|
|
173
|
-
* @
|
|
174
|
-
*
|
|
300
|
+
* @returns Promise that resolves when the frame completes
|
|
301
|
+
*
|
|
175
302
|
* @example
|
|
176
|
-
*
|
|
177
|
-
*
|
|
303
|
+
* ```typescript
|
|
304
|
+
* // Game loop
|
|
305
|
+
* await runOnce(world);
|
|
306
|
+
* ```
|
|
178
307
|
*/
|
|
179
|
-
export async function
|
|
180
|
-
|
|
181
|
-
if (
|
|
182
|
-
|
|
308
|
+
export async function runOnce(world) {
|
|
309
|
+
// Rebuild all schedules if pipeline is dirty
|
|
310
|
+
if (world.schedules.dirty) {
|
|
311
|
+
rebuildPipeline(world);
|
|
183
312
|
}
|
|
184
|
-
//
|
|
185
|
-
world.execution.
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
313
|
+
// Run startup schedule on first call
|
|
314
|
+
if (!world.execution.startupRan) {
|
|
315
|
+
await executeSchedule(world, Startup);
|
|
316
|
+
world.execution.startupRan = true;
|
|
317
|
+
world.execution.shutdownRan = false;
|
|
318
|
+
}
|
|
319
|
+
// Run all pipeline schedules in order
|
|
320
|
+
for (let i = 0; i < world.schedules.pipeline.length; i++) {
|
|
321
|
+
await executeSchedule(world, world.schedules.pipeline[i]);
|
|
322
|
+
}
|
|
323
|
+
// Flush events at end of frame
|
|
324
|
+
flushEvents(world);
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Start the main loop using requestAnimationFrame.
|
|
328
|
+
*
|
|
329
|
+
* Startup schedule runs automatically on first frame. Each frame executes
|
|
330
|
+
* all pipeline schedules in order. Call stop() to end the loop.
|
|
331
|
+
*
|
|
332
|
+
* @param world - World instance
|
|
333
|
+
*
|
|
334
|
+
* @example
|
|
335
|
+
* ```typescript
|
|
336
|
+
* addSystem(world, physicsSystem);
|
|
337
|
+
* addSystem(world, renderSystem, { schedule: PostUpdate });
|
|
338
|
+
* run(world);
|
|
339
|
+
* // ... later
|
|
340
|
+
* await stop(world);
|
|
341
|
+
* ```
|
|
342
|
+
*/
|
|
343
|
+
export function run(world) {
|
|
344
|
+
if (world.execution.running) {
|
|
345
|
+
return;
|
|
346
|
+
}
|
|
347
|
+
world.execution.running = true;
|
|
348
|
+
scheduleFrame(world);
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Schedules the next animation frame for the game loop.
|
|
352
|
+
*/
|
|
353
|
+
function scheduleFrame(world) {
|
|
354
|
+
world.execution.rafHandle = requestAnimationFrame(async () => {
|
|
355
|
+
if (!world.execution.running) {
|
|
356
|
+
return;
|
|
357
|
+
}
|
|
358
|
+
try {
|
|
359
|
+
await runOnce(world);
|
|
360
|
+
}
|
|
361
|
+
catch (error) {
|
|
362
|
+
world.execution.running = false;
|
|
363
|
+
world.execution.rafHandle = null;
|
|
364
|
+
throw error;
|
|
365
|
+
}
|
|
366
|
+
if (world.execution.running) {
|
|
367
|
+
scheduleFrame(world);
|
|
196
368
|
}
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* Stop the main loop and run the shutdown schedule.
|
|
373
|
+
*
|
|
374
|
+
* @param world - World instance
|
|
375
|
+
* @returns Promise that resolves when shutdown completes
|
|
376
|
+
*
|
|
377
|
+
* @example
|
|
378
|
+
* ```typescript
|
|
379
|
+
* run(world);
|
|
380
|
+
* // ... later
|
|
381
|
+
* await stop(world);
|
|
382
|
+
* ```
|
|
383
|
+
*/
|
|
384
|
+
export async function stop(world) {
|
|
385
|
+
world.execution.running = false;
|
|
386
|
+
if (world.execution.rafHandle !== null) {
|
|
387
|
+
cancelAnimationFrame(world.execution.rafHandle);
|
|
388
|
+
world.execution.rafHandle = null;
|
|
197
389
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
world
|
|
201
|
-
|
|
390
|
+
// Rebuild if needed before shutdown
|
|
391
|
+
if (world.schedules.dirty) {
|
|
392
|
+
rebuildPipeline(world);
|
|
393
|
+
}
|
|
394
|
+
if (!world.execution.shutdownRan) {
|
|
395
|
+
await executeSchedule(world, Shutdown);
|
|
396
|
+
world.execution.shutdownRan = true;
|
|
397
|
+
world.execution.startupRan = false;
|
|
202
398
|
}
|
|
203
399
|
}
|
|
204
400
|
//# sourceMappingURL=scheduler.js.map
|
package/dist/scheduler.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduler.js","sourceRoot":"","sources":["../src/scheduler.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scheduler.js","sourceRoot":"","sources":["../src/scheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAoBzC,+EAA+E;AAC/E,sBAAsB;AACtB,+EAA+E;AAE/E;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,cAAc,CAAC,IAAY;IACzC,OAAO,IAAqB,CAAC;AAC/B,CAAC;AAED,+EAA+E;AA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