diff --git a/Projektgruppe_175/src/game/goals/PopulationGoal.java b/Projektgruppe_175/src/game/goals/PopulationGoal.java index 721032d..cb4a124 100644 --- a/Projektgruppe_175/src/game/goals/PopulationGoal.java +++ b/Projektgruppe_175/src/game/goals/PopulationGoal.java @@ -69,7 +69,7 @@ public class PopulationGoal extends Goal { if(highPopulationPlayers.size() == 1) { return highPopulationPlayers.get(0); } else if(highPopulationPlayers.size() > 1) { - // Spieler mit insgesamt größter Bevölkerung gewinnt + // Spieler mit meisten regionen gewinnt Comparator comp = new Comparator() { @@ -80,17 +80,13 @@ public class PopulationGoal extends Goal { }; - Collections.sort(playerList, comp); - // Edge Case: Mind. Zwei spieler haben die gleiche Anzahl an Burgen - if(playerList.get(0).getNumRegions(game) == playerList.get(1).getNumRegions(game)) { - isDraw = true; - return null; - } - - - return Collections.max(playerList, comp); - - } + Collections.sort(highPopulationPlayers, comp); + // Edge Case: Mehrere Spieler haben auch die gleiche Anzahl an Regionen. Dann gibt es ein Draw. + if(highPopulationPlayers.get(0).getNumRegions(game) == highPopulationPlayers.get(1).getNumRegions(game)) { + isDraw = true; + return null; + } + return Collections.max(highPopulationPlayers, comp); // Ansonsten... gewinnt noch kein spieler. return null;