feat: log tree from Module 2 (logTree / log_tree); SpellGrid CLIs print Log:
Engine events carry the nesting depth they were recorded at; the harness prints the log as an indented tree. New tests test_02_log_tree_shows_nesting and test_03_log_tree_death_phase; both SpellGrid CLIs print the tree of the last command's Sequences under a Log: line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
06a1b34c5d
commit
97c64ebee8
86 files changed
+1375
-55
No files matched your search
@@ -166,8 +166,11 @@ function react(world: World, events: Event[]): void {
|
||||
? positionLeftOf(world, world.ownerOf(source), event.before)
|
||||
: world.boardIndex(source);
|
||||
const actions = trigger.effect(new Ctx(world, world.ownerOf(source), source, undefined, position));
|
||||
// The trigger's consequences are one level deeper in the log tree.
|
||||
world.openBlock();
|
||||
// Depth-first: each action, and every reaction it causes, finishes before the next.
|
||||
for (const action of actions) perform(world, action);
|
||||
world.closeBlock();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user