Files
systemic-game-design-course/course/03-death-step/reference/rust
Lucas WintherandClaude Opus 5.5 638549161f
CI / Tool tests and sync-check (push) Successful in 13s
CI / Verify references (all modules, Rust and TS) (push) Successful in 1m32s
CI / Verify Expansion Drop solutions (all modules, Rust and TS) (push) Successful in 1m35s
CI / Coupling audit on references (push) Successful in 13s
CI / Site build (push) Successful in 25s
CI / Naive engine tests (Module 0) (push) Successful in 32s
feat(ci): verify Expansion Drop solutions; README quick start, disclaimer link; Rust reference lockfiles
- verify-references --expansion overlays expansion/solution on each reference and runs the
  cumulative tests plus the drop test; refuses a solution that touches src/engine/
- CI job verify-expansions
- README: workspace-template + git init step, tool list, repo disclaimer link
- Cargo.lock for every Rust reference (staged with the reference, pins serde for rustc 1.85.1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 19:13:11 +01:00
..
2026-10-29 02:42:12 +01:00
2026-10-29 02:42:12 +01:00
2026-10-29 02:42:12 +01:00
2026-10-29 02:42:12 +01:00
2026-10-29 02:42:12 +01:00

Module 3 reference engine (Rust)

The course's own engine as of the end of Module 3. It adds deferred death: damage and destroy effects only mark minions, and the Death Creation Step removes them when the outermost Phase ends, followed by Death Phases that resolve Deathrattles until no new deaths occur. Module 2's reference was the starting point, so a diff between the two shows what this module adds. Module 4's reference starts from this one.

  • src/engine/: generic machinery. Names no cards.
    • queue.rs: actions, the context an effect sees, and the resolver. A Sequence performs its action, then runs the end-of-outermost-Phase steps and the Death Phase loop. Module 4's aura updates go in the marked seam next to the Death Creation Step. A Death Phase is the same Phase function as a damage reaction, fed Death Events; the dead minion answers its own Death Event with its Deathrattle.
    • death.rs: the Death Creation Step. It collects every mortally wounded or pending-destroy minion, reads all their board positions first, then removes them together and returns their Death Events in order of play.
    • world.rs: entities, zones, order of play, heroes, stats, Armor, the pending-destroy flag and the log. Every state change records its event, except marking a minion pending destroy, which the course log does not show.
    • card.rs: card definitions (stats, triggers, a spell's effect) and the library.
    • event.rs: the engine's events. A Death Event also carries the remembered board position. 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. destroy runs one Sequence that marks its target. play is still the Module 1 Expansion Drop stub.

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