mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
cheaks if all player are dead and then exits game
This commit is contained in:
parent
fd7a0f5bc3
commit
4fe0439297
@ -306,6 +306,11 @@ public class RoboRallyGame implements DrawableGame, InteractableGame {
|
|||||||
if (host) {
|
if (host) {
|
||||||
server.setDeadPlayers(gameBoard.getRealDeadRobots());
|
server.setDeadPlayers(gameBoard.getRealDeadRobots());
|
||||||
}
|
}
|
||||||
|
playerList.removeIf((player) -> gameBoard.getRealDeadRobots().contains(player.getRobotID()));
|
||||||
|
if(playerList.isEmpty()){
|
||||||
|
System.exit(1);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -68,5 +68,5 @@ public class RobotTest {
|
|||||||
testRobot.setLastFlagVisited(nextFlag);
|
testRobot.setLastFlagVisited(nextFlag);
|
||||||
assertEquals(1, testRobot.getLastFlagVisited());
|
assertEquals(1, testRobot.getLastFlagVisited());
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user