Update PopulationGoal.java woops
This commit is contained in:
parent
92fab9ea41
commit
d41993521c
1 changed files with 8 additions and 12 deletions
|
|
@ -69,7 +69,7 @@ public class PopulationGoal extends Goal {
|
||||||
if(highPopulationPlayers.size() == 1) {
|
if(highPopulationPlayers.size() == 1) {
|
||||||
return highPopulationPlayers.get(0);
|
return highPopulationPlayers.get(0);
|
||||||
} else if(highPopulationPlayers.size() > 1) {
|
} else if(highPopulationPlayers.size() > 1) {
|
||||||
// Spieler mit insgesamt größter Bevölkerung gewinnt
|
// Spieler mit meisten regionen gewinnt
|
||||||
|
|
||||||
Comparator<Player> comp = new Comparator<Player>() {
|
Comparator<Player> comp = new Comparator<Player>() {
|
||||||
|
|
||||||
|
|
@ -80,17 +80,13 @@ public class PopulationGoal extends Goal {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
Collections.sort(playerList, comp);
|
Collections.sort(highPopulationPlayers, comp);
|
||||||
// Edge Case: Mind. Zwei spieler haben die gleiche Anzahl an Burgen
|
// Edge Case: Mehrere Spieler haben auch die gleiche Anzahl an Regionen. Dann gibt es ein Draw.
|
||||||
if(playerList.get(0).getNumRegions(game) == playerList.get(1).getNumRegions(game)) {
|
if(highPopulationPlayers.get(0).getNumRegions(game) == highPopulationPlayers.get(1).getNumRegions(game)) {
|
||||||
isDraw = true;
|
isDraw = true;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
return Collections.max(highPopulationPlayers, comp);
|
||||||
|
|
||||||
return Collections.max(playerList, comp);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
// Ansonsten... gewinnt noch kein spieler.
|
// Ansonsten... gewinnt noch kein spieler.
|
||||||
return null;
|
return null;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue