refactor: changed returnType of checkRequestsAndApply to list
This commit is contained in:
		@ -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());
 | 
				
			||||||
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user