Added a new column to the table list showing the number of wins for matches and number of used / total seats for tournaments.

This commit is contained in:
LevelX2 2013-03-26 17:18:43 +01:00
parent 53a4caf9be
commit 12a01788e6
3 changed files with 27 additions and 13 deletions

View file

@ -50,6 +50,7 @@ public class TableView implements Serializable {
private String deckType;
private String tableName;
private String controllerName;
private String additionalInfo;
private Date createTime;
private TableState tableState;
private boolean isTournament;
@ -69,10 +70,14 @@ public class TableView implements Serializable {
seats.add(new SeatView(seat));
}
if (!table.isTournament()) {
this.additionalInfo = new StringBuilder("Wins: ").append(table.getMatch().getWinsNeeded()).toString();
for (Game game: table.getMatch().getGames()) {
games.add(game.getId());
}
} else {
this.additionalInfo = new StringBuilder("Seats: ").append(table.getTournament().getPlayers().size()).append("/").append(table.getNumberOfSeats()).toString();
}
}
public UUID getTableId() {
@ -114,5 +119,8 @@ public class TableView implements Serializable {
public boolean isTournament() {
return this.isTournament;
}
public String getAdditionalInfo() {
return this.additionalInfo;
}
}