Skip to content
Fabio Ticconi edited this page Jul 30, 2016 · 6 revisions

Basic Dispatching

Dispatching events is fairly easy. Dispatched events are sent synchronously to all registered event handlers one by one.

eventSystem.dispatch(new MyEvent());

eventSystem.dispatch() will block until all of the events have been called. There currently is no mechanic to avoid loops or stack overflows, so take care!

Dispatching from Systems or Managers

You can easily dispatch events from systems and managers.

public static class DispatchSystem extends BaseSystem {

    EventSystem es;

    @Override
    protected void processSystem() {
        es.dispatch(new MyEvent());
    }
}

Customized Dispatching

You can override the dispatching functionality by providing your own EventDispatchStrategy.