EventManager
Owns the running of one screen's event chains — the counterpart of TilesManager on the event side, one instance per screen. Given an EventTrigger to look up, or an EventSchema/list of them to run directly, it builds a fresh EventRunningScope wired to that screen's collaborators and dispatches to the matching dev.catbit.mosaic.client.ui.sdui.foundation.events.EventRunner via eventRunnerManager.
EventManager and TilesManager are constructed together for a screen but depend on each other (an event needs to edit the tile tree; a tile's local interaction needs to run events) — that circular dependency is resolved by constructing EventManager with only screenId, eventRunnerManager and koinScope up front, then wiring in the TilesManager-provided collaborators immediately after via attachTilesEditor/attachTilesOverlaysEditor/ attachTilesEventHolder/attachTilesEventDispatcher/attachTilesValueProducer, plus attachScreenBehaviors/attachDataHolder for the screen-level ones. Every runEvent call is expected to happen only after all of these have been attached.
Parameters
id of the screen this manager runs events for — forwarded as EventRunningScope.screenId on every run.
registry resolving an EventSchema's concrete class to its dev.catbit.mosaic.client.ui.sdui.foundation.events.EventRunner.
the Koin scope every built EventRunningScope resolves dependencies from, and that runEvent itself uses to reach a MosaicLogger for its own top-level error handling.
Functions
Wires in the ScreenDataHolder every subsequently-run event's EventRunningScope exposes as screenDataHolder.
Wires in the ScreenBehaviorsHolder every subsequently-run event's EventRunningScope exposes as screenBehaviorsHolder.
Wires in the TilesEditor every subsequently-run event's EventRunningScope exposes as tilesEditor. Must be called (typically right after construction, by the screen's TilesManager) before runEvent is used.
Wires in the TilesEventDispatcher every subsequently-run event's EventRunningScope exposes as tilesEventDispatcher.
Wires in the TilesEventHolder uses to look up which registered events match a given trigger.
Wires in the TilesOverlaysEditor every subsequently-run event's EventRunningScope exposes as tilesOverlaysEditor.
Wires in the TilesValueProducer every subsequently-run event's EventRunningScope exposes as tilesValueProducer.
Builds a fresh EventRunningScope for eventSchema — wired to this manager's own screenId, koinScope, and every collaborator attached via the attach* methods above, plus this EventManager itself (so the scope's own onTrigger/runEventInline/runEventsInline can recurse back through runEvent) — and dispatches to the dev.catbit.mosaic.client.ui.sdui.foundation.events.EventRunner registered for eventSchema's concrete class, via eventRunnerManager.
Runs every entry in eventSchemas in order via runEvent — used when a caller already has the exact list of events to run and doesn't need triggerEvents' trigger lookup.
Looks up every currently-registered EventSchema on this screen whose trigger equals trigger (via tilesEventHolder) and runs each one — the entry point for a screen-level trigger like onDisplay(), which isn't tied to a single tile's own events list the way dev.catbit.mosaic.client.ui.sdui.foundation.tiles.renderer.TileRenderingScope.triggerEvent is.