Ejemplo n.º 1
0
 @Override
 public ImmutableList<TPlayer> getPlayersBestFirst() {
   ImmutableList.Builder<TPlayer> builder = ImmutableList.builder();
   for (TPlayerScore score : scores) {
     builder.add(score.getPlayer());
   }
   return builder.build();
 }
Ejemplo n.º 2
0
 @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();
 }
Ejemplo n.º 3
0
 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);
 }