Expand description
Handler collection, the Showdown comparePriority comparator, the speed-tie
draw, and the run_event dispatch fold (design §1.3, §3.4).
Structs§
- Collected
Handler - One collected, sortable handler invocation (design §1.3). The comparator orders these by the exact Showdown lexical order.
Functions§
- collect_
from_ effect - Collect, from a single known effect, the hooks that subscribe to
ev, wrapping each with its host’s speed andeffect_orderfrom the arena. - collect_
handlers - Multi-source handler collection (design §2.2) — the broadened collector.
- compare
- The exact Showdown
comparePrioritylexical order (design §1.3): order → priority → speed → sub_order → effect_order. - run_
event - The dispatch fold (design §3.4) — the workhorse.
- run_
event_ checked - The dispatch fold with the §2.3 per-step liveness re-check — the multi-source variant.
- speed_
sort_ tiebreak - Permute only the tied runs (
compare == Equal) by drawing one byte from the rng per tie — the single source of true handler-order randomness (design §1.3, mirroring pokered’s order coin-flip, bug #22).