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:
src
main
java
inf112
fiasko
roborally
objects
test
java
inf112
fiasko
roborally
objects
@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user