summaryrefslogtreecommitdiff
path: root/src/main/java/ftbsc/geb/api/IEventDispatcher.java
blob: 25ec657d5d6f655d5fe37820b5dc2797a4806fb8 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package ftbsc.geb.api;

import java.util.Map;

/**
 * The interface that the generated dispatchers will all use.
 * This interface isn't really meant to be used by humans, but it should work if your
 * use case requires it.
 * @since 0.1.1
 */
public interface IEventDispatcher {
   /**
    * Calls all listeners for the given identifier.
    * @param identifier the identifier of the bus that's calling this
    * @param event the event to call
    * @param listeners a map mapping each {@link IListener} class to its instance
    * @return the value {@link IBus#handleEvent(IEvent)} will return for this
    */
   boolean callListeners(String identifier, IEvent event, Map<Class<? extends IListener>, IListener> listeners);

   /**
    * @return the {@link Class} representing the event this dispatcher works with
    */
   Class<? extends IEvent> eventType();
}