"use strict"; // Layer: entity-runtime/items/pipeline // Owns the ordered item lifecycle pipeline. There is no monolithic fallback path: // every item update must be handled by the explicit lifecycle steps below. (function (global) { const CONCRETE_STEP_NAMES = Object.freeze([ "TarinaiItemFrameLifecycleStep", "TarinaiItemDecayLifecycleStep", "TarinaiItemDynamicLifecycleStep", "TarinaiItemGrowthLifecycleStep", ]); function concreteSteps() { return CONCRETE_STEP_NAMES.map(name => global[name]).filter(step => step && typeof step.update === "function"); } function canRunConcretePipeline() { return concreteSteps().length === CONCRETE_STEP_NAMES.length; } function updateOne(item, dt, worldRef, options = {}) { if (!item || item.dead || !canRunConcretePipeline()) return false; const context = options.context || {}; for (const step of concreteSteps()) { const result = step.update(item, dt, worldRef, context) || {}; if (result.done) return result.ok !== false; } return true; } global.TarinaiItemLifecyclePipeline = Object.freeze({ stepNames: CONCRETE_STEP_NAMES, canRunConcretePipeline, updateOne, }); })(typeof window !== "undefined" ? window : globalThis);