1
0
mirror of https://github.com/inf112-v20/Fiasko.git synced 2025-07-05 07:34:43 +02:00

cheaks if all player are dead and then exits game

This commit is contained in:
Tobydrama
2020-04-20 18:48:53 +02:00
parent fd7a0f5bc3
commit 4fe0439297
2 changed files with 6 additions and 1 deletions
src
main
java
inf112
fiasko
roborally
test
java
inf112
fiasko
roborally

@ -306,6 +306,11 @@ public class RoboRallyGame implements DrawableGame, InteractableGame {
if (host) {
server.setDeadPlayers(gameBoard.getRealDeadRobots());
}
playerList.removeIf((player) -> gameBoard.getRealDeadRobots().contains(player.getRobotID()));
if(playerList.isEmpty()){
System.exit(1);
}
}
/**