use of pl.themolka.arcade.match.MatchWinner in project Arcade2 by ShootGame.
the class ScoreGame method getDynamicWinners.
@Override
public List<MatchWinner> getDynamicWinners() {
double highestScore = Score.MIN;
List<MatchWinner> results = new ArrayList<>();
for (MatchWinner winner : this.getMatch().getWinnerList()) {
if (winner.areGoalsCompleted()) {
results.add(winner);
}
Score score = this.getScore(winner);
if (score == null) {
continue;
} else if (score.getScore() > highestScore) {
results.clear();
highestScore = score.getScore();
}
if (!results.contains(winner) && score.getScore() >= highestScore) {
results.add(winner);
}
}
if (highestScore != Score.MIN && !results.isEmpty()) {
return results;
}
return null;
}
Aggregations