emit method

void emit(
  1. GameEvent event
)

Emits event to every current subscriber whose type matches. A no-op once dispose has run — a gameplay callback racing a screen's own teardown shouldn't crash on a stale bus reference.

Implementation

void emit(GameEvent event) {
  if (_controller.isClosed) return;
  _controller.add(event);
}