feat: add proper game initialization
This commit is contained in:
@ -53,19 +53,29 @@ class GameStateManager {
|
||||
return (Event[])GameLogic.checkTurnEnd(state).toArray();
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes the game.
|
||||
* @param selectedCharacters1 The characters selected by player 1
|
||||
* @param selectedCharacters2 The characters selected by player 2
|
||||
* @return The resulting {@link Event}s
|
||||
*/
|
||||
public Event[] initGame(ArrayList<Integer> selectedCharacters1, ArrayList<Integer> selectedCharacters2) {
|
||||
return GameLogic.startGame(state, selectedCharacters1, selectedCharacters2).toArray(new Event[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Starts the game.
|
||||
* @return The resulting {@link Event}s
|
||||
*/
|
||||
public Event[] startGame() {
|
||||
return (Event[])GameLogic.handleTurnEnd(state).toArray();
|
||||
return GameLogic.handleRoundStart(state).toArray(new Event[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Applies an array of {@link Event}s to the game state.
|
||||
* @param events The events to apply
|
||||
*/
|
||||
public void applyEvents(Event[] events) {
|
||||
public void applyEvents(Event... events) {
|
||||
for(Event event: events) {
|
||||
GameLogic.applyEvent(state, event);
|
||||
}
|
||||
|
Reference in New Issue
Block a user