feat(bt): Rename repeat to cycle and refactor runner
Rework task execution to be synchronous within a single tick. Scheduling boundaries are now defined by `cycle` nodes, which replace the previous `repeat` decorator. All tasks are executed immediately when scheduled, and parent/child propagation is handled inline.
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
// Behaviour Tree (buildTree) — controls game flow:
|
||||
// parallel
|
||||
// ├── dealerPlay (leaf) — generator loop, auto-plays dealer hand
|
||||
// └── repeat
|
||||
// └── cycle
|
||||
// └── seq (sequential)
|
||||
// ├── handleInput (leaf) — reads queued commands
|
||||
// └── render (leaf) — draws via blessed
|
||||
@@ -27,7 +27,7 @@ import {
|
||||
buildTree,
|
||||
leaf,
|
||||
parallel,
|
||||
repeat,
|
||||
cycle,
|
||||
sequential,
|
||||
} from "../../src/bt/index";
|
||||
import { CommandQueue } from "../../src/commands/index";
|
||||
@@ -88,7 +88,7 @@ const runner = buildTree(
|
||||
}
|
||||
}
|
||||
}),
|
||||
repeat(
|
||||
cycle(
|
||||
sequential([
|
||||
leaf(() => {
|
||||
commands.execute();
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
// Behaviour Tree (buildTree) — controls game flow:
|
||||
// parallel
|
||||
// ├── gravityTick (leaf) — generator loop, auto-drop piece on timer
|
||||
// └── repeat
|
||||
// └── cycle
|
||||
// └── seq (sequential)
|
||||
// ├── handleInput (leaf) — reads queued commands
|
||||
// └── render (leaf) — draws via blessed
|
||||
@@ -24,7 +24,7 @@ import {
|
||||
buildTree,
|
||||
leaf,
|
||||
parallel,
|
||||
repeat,
|
||||
cycle,
|
||||
sequential,
|
||||
} from "../../src/bt/index";
|
||||
import { CommandQueue } from "../../src/commands/index";
|
||||
@@ -95,7 +95,7 @@ const runner = buildTree(
|
||||
}
|
||||
}
|
||||
}),
|
||||
repeat(
|
||||
cycle(
|
||||
sequential([
|
||||
leaf(() => {
|
||||
commands.execute();
|
||||
|
||||
Reference in New Issue
Block a user