Изменение интерфейса

This commit is contained in:
Gravit 2018-10-18 20:57:49 +07:00
parent 78d6321f9f
commit fc6a29cfa2
No known key found for this signature in database
GPG key ID: 061981E1E85D3216
2 changed files with 4 additions and 2 deletions

View file

@ -1,6 +1,8 @@
package ru.gravit.utils.event; package ru.gravit.utils.event;
import java.util.UUID;
@FunctionalInterface @FunctionalInterface
public interface EventHandler<T extends EventInterface> { public interface EventHandler<T extends EventInterface> {
void run(T event); void run(UUID uuid, T event);
} }

View file

@ -48,7 +48,7 @@ public void process(UUID key, EventInterface event)
{ {
for(Entry e : handlers) for(Entry e : handlers)
{ {
if(Arrays.binarySearch(e.events,key) >= 0) e.func.run(event); if(Arrays.binarySearch(e.events,key) >= 0) e.func.run(key, event);
} }
} }
public class EventExecutor implements Runnable { public class EventExecutor implements Runnable {