Files
the-beacon/reference/npc-logic.js
Alexander Whitestone 3db10d5813
Some checks failed
Accessibility Checks / a11y-audit (pull_request) Has been cancelled
Smoke Test / smoke (pull_request) Has been cancelled
chore: move dormant prototypes to reference/ directory (closes #199)
2026-04-16 01:15:52 -04:00

26 lines
1.1 KiB
JavaScript

/**
* ╔══════════════════════════════════════════════════════════════╗
* ║ DORMANT PROTOTYPE ║
* ║ This file is not part of the active architecture. ║
* ║ Preserved for reference only. See active game logic elsewhere. ║
* ╚══════════════════════════════════════════════════════════════╝
*/
class NPCStateMachine {
constructor(states) {
this.states = states;
this.current = 'idle';
}
update(context) {
const state = this.states[this.current];
for (const transition of state.transitions) {
if (transition.condition(context)) {
this.current = transition.target;
console.log(`NPC transitioned to ${this.current}`);
break;
}
}
}
}
export default NPCStateMachine;