stable
This commit is contained in:
parent
fbdac9ebf1
commit
86226ccc94
97 changed files with 5790 additions and 2307 deletions
23
js/simulation.js
Normal file
23
js/simulation.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
"use strict";
|
||||
|
||||
// Layer: simulation
|
||||
// Single update entrypoint. World owns state; phase modules own the ordered update work.
|
||||
(function (global) {
|
||||
function update(worldRef, dt) {
|
||||
const order = global.TarinaiSystemOrder;
|
||||
if (order?.update) return order.update(worldRef, dt);
|
||||
const phases = global.TarinaiWorldUpdatePhases;
|
||||
if (!phases?.update) throw new Error("TarinaiWorldUpdatePhases is not available");
|
||||
return phases.update(worldRef, dt);
|
||||
}
|
||||
|
||||
function phases() {
|
||||
return global.TarinaiWorldUpdatePhases?.phases || null;
|
||||
}
|
||||
|
||||
function systemOrder() {
|
||||
return global.TarinaiSystemOrder?.names || null;
|
||||
}
|
||||
|
||||
global.TarinaiSimulation = Object.freeze({ update, phases, systemOrder });
|
||||
})(typeof window !== "undefined" ? window : globalThis);
|
||||
Loading…
Add table
Add a link
Reference in a new issue