Skip to main content

Module dispatch

Module dispatch 

Source
Expand description

Handler collection, the Showdown comparePriority comparator, the speed-tie draw, and the run_event dispatch fold (design §1.3, §3.4).

Structs§

CollectedHandler
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 and effect_order from the arena.
collect_handlers
Multi-source handler collection (design §2.2) — the broadened collector.
compare
The exact Showdown comparePriority lexical 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).