22 lines
735 B
JavaScript
22 lines
735 B
JavaScript
|
|
"use strict";
|
||
|
|
|
||
|
|
// Public Tarinai need-planning entrypoint. This owns the resolveNeeds boundary
|
||
|
|
// used by Tarinai.prototype.resolveNeeds and by future planner decomposition.
|
||
|
|
|
||
|
|
(function (global) {
|
||
|
|
function updateOne(tarinai, dt = 0) {
|
||
|
|
if (!tarinai || tarinai.dead) return false;
|
||
|
|
global.TarinaiForcedActionPlannerSystem?.prepare?.(tarinai, dt);
|
||
|
|
return Boolean(global.TarinaiActionPlannerSystem?.updateOne?.(tarinai, dt)
|
||
|
|
?? global.TarinaiNeedPlannerLegacySystem?.updateOne?.(tarinai, dt));
|
||
|
|
}
|
||
|
|
|
||
|
|
function updateWithThis(dt = 0) {
|
||
|
|
return updateOne(this, dt);
|
||
|
|
}
|
||
|
|
|
||
|
|
global.TarinaiNeedPlannerSystem = Object.freeze({
|
||
|
|
updateOne,
|
||
|
|
updateWithThis,
|
||
|
|
});
|
||
|
|
})(typeof window !== "undefined" ? window : globalThis);
|