Skip to main content

Module state

Module state 

Source
Expand description

GameState — a pure fold over the event log.

apply is the fold step: no RNG, no clock, no I/O, no engine calls. All of those live in commands::step, which produces events; this module only consumes them. replay(events) is therefore save-loading, bug reproduction, and (later) counterfactual branch points, all in one.

Structs§

GameState
TableRow
One league-table row. The table is derived, never stored — same philosophy as CA: results are the single source of truth, the table is a view.

Functions§

league_table
Standings from an arbitrary results map (callers may merge not-yet-applied events in). Sort: points, goal difference, goals for, then club name — fully deterministic.