/**
* @param offset
* @return the actual HighscoreResponseMessage to send to clients.
*/
public HighscoreResponseMessage getHighscoreMessage(int offset) {
HighscoreResponseMessage highscoreResponseMessage = new HighscoreResponseMessage();
Set<HighscoreEntry> highscoreEntries = new HashSet<HighscoreEntry>();
Set<Player> players = AuthenticationService.getPlayers(offset);
for (Player player : players) {
HighscoreEntry highscoreEntry = new HighscoreEntry();
highscoreEntry.setPlayerName(player.getName());
highscoreEntry.setPoints(player.getElopoints() - 500);
highscoreEntry.setOldPoints(player.getOldElopoints() - 500);
highscoreEntries.add(highscoreEntry);
}
highscoreResponseMessage.setHighscoreEntries(highscoreEntries);
return highscoreResponseMessage;
}