List<RobotPeer> orderedRobots = new ArrayList<RobotPeer>(robots);
Collections.sort(orderedRobots);
Collections.reverse(orderedRobots);
for (int rank = 0; rank < robots.size(); rank++) {
RobotPeer robotPeer = orderedRobots.get(rank);
robotPeer.getStatistics().setRank(rank + 1);
BattleResults battleResults = robotPeer.getStatistics().getFinalResults();
robotPeer.addEvent(new BattleEndedEvent(isAborted(), battleResults));
}
}
}
if (endTimer > 4 * TURNS_DISPLAYED_AFTER_ENDING) {
for (RobotPeer robotPeer : robots) {
robotPeer.setHalt(true);
}
}
super.shutdownTurn();
}