Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3db10d5813 |
@@ -1,18 +0,0 @@
|
||||
|
||||
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;
|
||||
@@ -1,3 +1,10 @@
|
||||
/**
|
||||
* ╔══════════════════════════════════════════════════════════════╗
|
||||
* ║ DORMANT PROTOTYPE ║
|
||||
* ║ This file is not part of the active architecture. ║
|
||||
* ║ Preserved for reference only. See active game logic elsewhere. ║
|
||||
* ╚══════════════════════════════════════════════════════════════╝
|
||||
*/
|
||||
|
||||
/**
|
||||
* Symbolic Guardrails for The Beacon
|
||||
25
reference/npc-logic.js
Normal file
25
reference/npc-logic.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/**
|
||||
* ╔══════════════════════════════════════════════════════════════╗
|
||||
* ║ 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;
|
||||
Reference in New Issue
Block a user