title: Event Dispacher in Java
body: <p>I need to to make for school a simple "strategy game simulator". To do this I need to make an Event Dispatcher (event loop) that will send the event to the registered parties. For example, I have resources on the map. One event is "resource at location 1 depleted". And one "player" is interested on that event. 
  How would I create the dispatcher (and register one player for one particular event). Also, how does the dispatcher check for the event? Does it simply do something like <code>if(resourceLocation1.getNoResource()==0) trigerEvent();</code> or is there some other, more elegant way.</p>
  
  <p>I worked with event listeners (mostly in ActionScrip3) but never made a custom event and a custom event dispatcher. Any help is appreciated, including some links to some tutorials or sample codes.</p>
  
  <p>If I am not clear what I am searching for please let me know and I will try to explain it better</p>
  
  <p>Thanks.</p>