tarinai/js/item_lifecycle_step_legacy.js
2026-06-26 12:46:32 +09:00

15 lines
653 B
JavaScript

"use strict";
// Layer: entity-runtime/items/lifecycle-step
// Fallback step for environments where the split item lifecycle pipeline cannot
// run. The captured legacy Item.prototype.update is kept by item_runtime.js.
(function (global) {
function update(item, dt, worldRef, context = {}) {
const legacyUpdate = context.legacyUpdate;
if (!item || item.dead || typeof legacyUpdate !== "function") return { done: true, ok: false };
legacyUpdate.call(item, dt, worldRef);
return { done: true, ok: true };
}
global.TarinaiItemLegacyLifecycleStep = Object.freeze({ update });
})(typeof window !== "undefined" ? window : globalThis);