A named-event registry whose handlers can be removed in bulk by whatever registered them.
Distinct from Signal, which is one event with one payload and a consuming, LIFO listener
order: this is many events keyed by name, dispatched in registration order, with a source
tag so everything an ability or a worn item put here comes off in one call when that thing
leaves. mwg names no events of its own - the strings are whatever a game's own loop
actually fires.
battle.BattleHooks and roguelike.CombatHooks are both this, with their argument types
fixed and their own documentation attached. They used to be two line-for-line copies of the
same class; the difference between them was never the registry, only what a handler is
handed when it runs.
A named-event registry whose handlers can be removed in bulk by whatever registered them.
Distinct from
Signal, which is one event with one payload and a consuming, LIFO listener order: this is many events keyed by name, dispatched in registration order, with asourcetag so everything an ability or a worn item put here comes off in one call when that thing leaves.mwgnames no events of its own - the strings are whatever a game's own loop actually fires.battle.BattleHooksandroguelike.CombatHooksare both this, with their argument types fixed and their own documentation attached. They used to be two line-for-line copies of the same class; the difference between them was never the registry, only what a handler is handed when it runs.Example