2021-05-03 18:19:17 +00:00
|
|
|
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) {
|
2021-05-18 15:24:07 +00:00
|
|
|
handle((Event[])arg);
|
2021-05-03 18:19:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Gets called with incoming {@link Event}s. Override this method to handle events.
|
2021-05-18 15:24:07 +00:00
|
|
|
* @param event The events that got emitted
|
2021-05-03 18:19:17 +00:00
|
|
|
*/
|
2021-05-18 15:24:07 +00:00
|
|
|
protected void handle(Event[] event) {
|
2021-05-03 18:19:17 +00:00
|
|
|
|
|
|
|
}
|
|
|
|
}
|