public interface EventHandler
An EventHandler can accept any type of GameEvent, but generally you want an EventHandler to only handle a specific type of GameEvent. The Handler can check the type of GameEvent it received using the instanceof operator.
boolean handle(GameEvent event)
The GameEvent can generally be down casted to the type of GameEvent that the EventHandler was registered to listen for. However, EventHandlers should always use the instanceof operator to double check before casting to avoid throwing a ClassCastException.
After handling a GameEvent, this method should return true in order to allow other handlers to receive the GameEvent. If propagation of the GameEvent should halt, this method should return false.
event
- The event to handle.