package pw.sponges.dubtrack4j.event.framework;

import pw.sponges.dubtrack4j.event.*;

import java.util.ArrayList;
import java.util.List;

public class EventManager {

    private List<Listener> listeners;

    public EventManager() {
        this.listeners = new ArrayList<>();
    }

    public void registerListener(Listener listener) {
        listeners.add(listener);
    }

    public void unregisterListener(Listener listener) {
        listeners.remove(listener);
    }

    public void handle(Event event) {
        for (Listener l : listeners) {
            if (event instanceof UserChatEvent) l.onChat((UserChatEvent) event);
            else if (event instanceof UserJoinEvent) l.onJoin((UserJoinEvent) event);
            else if (event instanceof UserLeaveEvent) l.onLeave((UserLeaveEvent) event);
            else if (event instanceof SongChangeEvent) l.onSongChange((SongChangeEvent) event);
            else if (event instanceof UserDubEvent) l.onUserDub((UserDubEvent) event);
            //else if (event instanceof UserKickEvent) l.onUserKick((UserKickEvent) event);
        }
    }

}

@@ -592,24 +592,42 @@
 erChatEvent)
+ %7B%0A               
  l.onChat((U
@@ -651,32 +651,34 @@
 nt);%0A           
+ %7D
  else if (event 
@@ -698,24 +698,42 @@
 erJoinEvent)
+ %7B%0A               
  l.onJoin((U
@@ -757,32 +757,34 @@
 nt);%0A           
+ %7D
  else if (event 
@@ -805,24 +805,42 @@
 rLeaveEvent)
+ %7B%0A               
  l.onLeave((
@@ -866,32 +866,34 @@
 nt);%0A           
+ %7D
  else if (event 
@@ -915,24 +915,42 @@
 ChangeEvent)
+ %7B%0A               
  l.onSongCha
@@ -990,16 +990,18 @@
         
+ %7D
  else if
@@ -1028,24 +1028,42 @@
 serDubEvent)
+ %7B%0A               
  l.onUserDub
@@ -1097,16 +1097,18 @@
         
+ %7D
  //else 
@@ -1142,16 +1142,37 @@
 ckEvent)
+  %7B%0A            //   
  l.onUse
@@ -1193,32 +1193,48 @@
 kEvent) event);%0A
+            //%7D%0A
         %7D%0A    %7D%0A

Use brackets you swine