jtransc.game.event.EventDispatcher Maven / Gradle / Ivy
The newest version!
package jtransc.game.event;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
public class EventDispatcher {
public interface Handler {
void handle(T value);
}
private Map, ArrayList>> eventHandlers = new HashMap, ArrayList>>();
public void addEventListener(Class clazz, Handler handler) {
if (!eventHandlers.containsKey(clazz)) {
eventHandlers.put((Class
© 2015 - 2025 Weber Informatics LLC | Privacy Policy