@Override public ImmutableList<TPlayer> getPlayersBestFirst() { ImmutableList.Builder<TPlayer> builder = ImmutableList.builder(); for (TPlayerScore score : scores) { builder.add(score.getPlayer()); } return builder.build(); }
@Override public String toString() { StringBuilder sb = new StringBuilder(); int position = 1; for (TPlayerScore score : scores) { sb.append(position) .append(") ") .append(score.getPlayer().getId()) .append(" (") .append(score.getScore()) .append(")") .append("\n"); position++; } return sb.toString(); }
public static StandardRanking createForSeeding(TSeeding initialSeeding) { List<TPlayerScore> scores = Lists.newArrayList(); ImmutableList<TPlayer> players = initialSeeding.getPlayersBestFirst(); for (int i = 0; i < players.size(); i++) { TPlayer player = players.get(i); scores.add(TPlayerScore.create(player, EmptyScore.create(), i)); } return StandardRanking.create(scores); }