refactor: changed returnType of checkRequestsAndApply to list

This commit is contained in:
Yannik Bretschneider 2021-06-01 16:53:45 +02:00
parent 141469c11f
commit 0572450ced

View File

@ -8,6 +8,7 @@ import uulm.teamname.marvelous.gamelibrary.json.config.ScenarioConfig;
import uulm.teamname.marvelous.gamelibrary.requests.Request; import uulm.teamname.marvelous.gamelibrary.requests.Request;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
import java.util.Optional; import java.util.Optional;
/** Represents a game instance. */ /** Represents a game instance. */
@ -33,7 +34,7 @@ public class GameInstance {
* @param requests The requests to check * @param requests The requests to check
* @return The list of resulting {@link Event}s or `null` if the check failed * @return The list of resulting {@link Event}s or `null` if the check failed
*/ */
public Optional<ArrayList<Event>> checkRequestsAndApply(Request... requests) { public Optional<List<Event>> checkRequestsAndApply(Request... requests) {
if(manager.processRequests(requests, true)) { if(manager.processRequests(requests, true)) {
ArrayList<Event> result = manager.apply(); ArrayList<Event> result = manager.apply();
result.addAll(manager.checkPostPhase()); result.addAll(manager.checkPostPhase());