Files
systemic-game-design-course/course/02-action-queue/reference/rust
Lucas WintherandClaude Opus 5.5 85959ba5a0
CI / Tool tests and sync-check (push) Successful in 16s
CI / Verify references (all modules, Rust and TS) (push) Successful in 2m4s
CI / Verify Expansion Drop solutions (all modules, Rust and TS) (push) Successful in 2m1s
CI / Coupling audit on references (push) Successful in 5s
CI / Differential fuzzing of the Rust and TS references (300 seeds) (push) Successful in 53s
CI / Mutation check (tools/mutants.json against the highest TS reference) (push) Successful in 34s
CI / Verify the SpellGrid level proofs (solver) (push) Successful in 5m25s
CI / Site build (push) Successful in 15s
CI / Naive engine tests (Module 0) (push) Successful in 20s
fix: final review (engine errors end a Sequence cleanly; nesting guard labelled as the course's; Node 22.15; minor lesson and tool fixes)
I1: run-scenario and both SpellGrid CLIs check moves first and treat any other engine
error as fatal (same text in both tracks); trigger blocks close on error (try/finally,
catch_unwind in Rust); unknown summons rejected. I2, I3, M1-M7, T3, T9a-c, T10a-b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:58:27 +01:00
..
2026-10-29 02:30:26 +01:00
2026-10-29 02:30:26 +01:00
2026-10-29 02:30:26 +01:00
2026-10-29 02:30:26 +01:00

Module 2 reference engine (Rust)

The course's own engine as of the end of Module 2. It adds heroes, Health, Attack and Armor, triggered abilities, an event log, and the action queue that resolves one player action depth-first. Module 1's reference was the starting point, so a diff between the two shows what this module adds. Module 3's reference starts from this one.

  • src/engine/: generic machinery. Names no cards.
    • queue.rs: actions, the context an effect sees, and the resolver. Area damage creates every Damage Event before any trigger is queued; a Queue is filled once, oldest listener first, then locked; each trigger resolves completely before the next.
    • world.rs: entities, zones, order of play, heroes, stats, Armor and the log. Every state change records its event.
    • card.rs: card definitions (stats, triggers, a spell's effect) and the library.
    • event.rs: the engine's events. src/harness.rs translates them into the course's GameEvent.
  • src/content/mod.rs: card definitions. Each effect is a small function that returns actions; Module 5 turns them into data.
  • src/harness.rs: the adapter the course tests call. play is still the Module 1 Expansion Drop stub.

Run it with the module's tests: node tools/verify-references.mjs 02 from the course repository.