wip: implement post turn handling

This commit is contained in:
2021-05-19 19:59:41 +02:00
parent 7bac3bd46a
commit f3b5fc277e
4 changed files with 107 additions and 1 deletions

View File

@ -5,6 +5,7 @@ import uulm.teamname.marvelous.gamelibrary.events.Event;
import uulm.teamname.marvelous.gamelibrary.events.EventType;
import uulm.teamname.marvelous.gamelibrary.requests.Request;
import java.util.ArrayList;
import java.util.Observer;
/** Represents a game instance. */
@ -36,6 +37,12 @@ public class GameInstance {
public boolean checkRequestsAndApply(Request... requests) {
if(manager.processRequests(requests, true)) {
emit(manager.apply());
Event[] result = manager.checkPostPhase();
if(result.length > 0) {
emit(result);
}
return true;
}
return false;