feat: add method to end the current turn

This commit is contained in:
punchready 2021-06-03 02:21:12 +02:00
parent 3bb6d81b27
commit dd3201dfd2
2 changed files with 18 additions and 0 deletions

View File

@ -75,6 +75,14 @@ public class GameInstance {
return manager.startGame(selectedCharacters1, selectedCharacters2);
}
/**
* Forcefully ends the current turn.
* @return The list of resulting {@link Event}s
*/
public ArrayList<Event> endTurn() {
return manager.endTurn();
}
/**
* Produces a {@link EventType#GamestateEvent} for the current {@link GameState}.
* @return The resulting event

View File

@ -112,6 +112,16 @@ class GameStateManager {
return result;
}
/**
* Forcefully ends the current turn.
* @return The resulting {@link Event}s
*/
public ArrayList<Event> endTurn() {
ArrayList<Event> result = GameLogic.endTurn(state);
applyEvents(result);
return result;
}
/**
* Produces a {@link EventType#GamestateEvent} for the current {@link GameState}.
* @return The resulting event