public void trigger ( Object event ) { Set < Class > eventTypes = getAllInheritedClasses ( event . getClass ( ) ) ; for ( Class eventType : eventTypes ) { if ( observers . containsKey ( eventType ) ) { for ( EventObserver eventObserver : observers . get ( eventType ) ) { executionQueue . get ( ) . add ( new EventExecution ( event , eventObserver ) ) ; } } } triggerQueue ( ) ; }
Triggers an event through the EventManager . This will call the registered EventObservers with the provided event .