feat: implement method to start a game
This commit is contained in:
@ -490,7 +490,7 @@ class GameLogic {
|
||||
* @param state The game state to work on
|
||||
* @return The list of resulting {@link Event}s
|
||||
*/
|
||||
private static ArrayList<Event> handleTurnEnd(GameState state) {
|
||||
public static ArrayList<Event> handleTurnEnd(GameState state) {
|
||||
ArrayList<Event> result = new ArrayList<>();
|
||||
|
||||
ArrayList<EntityID> order = state.turnOrder;
|
||||
@ -521,8 +521,8 @@ class GameLogic {
|
||||
|
||||
}else {
|
||||
|
||||
int activeIndex = alive.indexOf(state.activeCharacter);
|
||||
if(activeIndex == alive.size() - 1) {
|
||||
int activeIndex = state.activeCharacter != null ? alive.indexOf(state.activeCharacter) : -1;
|
||||
if(activeIndex == -1 || activeIndex == alive.size() - 1) {
|
||||
state.activeCharacter = alive.get(0);
|
||||
//reached end of turn order, new round
|
||||
state.roundNumber++;
|
||||
|
Reference in New Issue
Block a user