Skip to content

Instantly share code, notes, and snippets.

@RX14
Created November 28, 2014 22:38
Show Gist options
  • Save RX14/7cf561d78f13d5751afb to your computer and use it in GitHub Desktop.
Save RX14/7cf561d78f13d5751afb to your computer and use it in GitHub Desktop.
public void poll()
{
List<ChatEvent> events = new ArrayList<>();
for (ISteph steph : stephs)
while (steph.moveNextEvent())
events.add(steph.getCurrentEvent());
for (ChatEvent event : events)
for (IMessageHandler handler : handlers)
for (IEventMatcher matcher : handler.getEventMatchers())
if (matcher.match(event))
{
handler.processEvent(event);
break;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment