Gamelib/src/main/java/uulm/teamname/marvelous/gamelibrary/gamelogic/EventObserver.java

23 lines
614 B
Java
Raw Normal View History

package uulm.teamname.marvelous.gamelibrary.gamelogic;
import uulm.teamname.marvelous.gamelibrary.events.Event;
import java.util.Observable;
import java.util.Observer;
/** Represents an event observer for game events emitted by an {@link EventEmitter}. */
public class EventObserver implements Observer {
@Override
public void update(Observable o, Object arg) {
handle((Event[])arg);
}
/**
* Gets called with incoming {@link Event}s. Override this method to handle events.
* @param event The events that got emitted
*/
protected void handle(Event[] event) {
}
}