refactor: changed some ArrayList types to Lists for compatibility
This commit is contained in:
parent
a69534ff72
commit
5202b63c2e
@ -81,7 +81,7 @@ public class GameInstance {
|
||||
* Applies an array of {@link Event Events} to the game state.
|
||||
* @param events The events to apply.
|
||||
*/
|
||||
public void applyEvents(ArrayList<Event> events) {
|
||||
public void applyEvents(List<Event> events) {
|
||||
manager.applyEvents(events);
|
||||
}
|
||||
|
||||
@ -91,7 +91,7 @@ public class GameInstance {
|
||||
* @param selectedCharacters2 The characters selected by player 2
|
||||
* @return The list of resulting {@link Event Events}
|
||||
*/
|
||||
public ArrayList<Event> startGame(ArrayList<Integer> selectedCharacters1, ArrayList<Integer> selectedCharacters2) {
|
||||
public List<Event> startGame(List<Integer> selectedCharacters1, List<Integer> selectedCharacters2) {
|
||||
return manager.startGame(selectedCharacters1, selectedCharacters2);
|
||||
}
|
||||
|
||||
|
@ -716,7 +716,7 @@ public class GameLogic {
|
||||
* @param selectedCharacters2 The characters selected by player 2
|
||||
* @return The list of resulting {@link Event Events}
|
||||
*/
|
||||
protected static ArrayList<Event> startGame(GameState state, ArrayList<Integer> selectedCharacters1, ArrayList<Integer> selectedCharacters2) {
|
||||
protected static ArrayList<Event> startGame(GameState state, List<Integer> selectedCharacters1, List<Integer> selectedCharacters2) {
|
||||
Logger.trace("Starting game");
|
||||
|
||||
ArrayList<Event> result = new ArrayList<>();
|
||||
|
@ -5,6 +5,7 @@ import uulm.teamname.marvelous.gamelibrary.events.EventType;
|
||||
import uulm.teamname.marvelous.gamelibrary.requests.Request;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/** Represents manager for a game state. */
|
||||
class GameStateManager {
|
||||
@ -63,7 +64,7 @@ class GameStateManager {
|
||||
* Applies an array of {@link Event Events} to the game state.
|
||||
* @param events The events to apply
|
||||
*/
|
||||
public void applyEvents(ArrayList<Event> events) {
|
||||
public void applyEvents(List<Event> events) {
|
||||
for(Event event: events) {
|
||||
GameLogic.applyEvent(state, event);
|
||||
}
|
||||
@ -111,7 +112,7 @@ class GameStateManager {
|
||||
* @param selectedCharacters2 The characters selected by player 2
|
||||
* @return The resulting {@link Event Events}
|
||||
*/
|
||||
public ArrayList<Event> startGame(ArrayList<Integer> selectedCharacters1, ArrayList<Integer> selectedCharacters2) {
|
||||
public List<Event> startGame(List<Integer> selectedCharacters1, List<Integer> selectedCharacters2) {
|
||||
GameState snapshot = state.snapshot();
|
||||
|
||||
ArrayList<Event> result = GameLogic.startGame(snapshot, selectedCharacters1, selectedCharacters2);
|
||||
|
Loading…
Reference in New Issue
Block a user