remove games from list when finished + added name and owner to tables

This commit is contained in:
BetaSteward 2011-05-09 23:02:54 -04:00
parent 2f515e242b
commit 017b2b4339
12 changed files with 770 additions and 624 deletions

View file

@ -47,7 +47,9 @@ import mage.players.Player;
public class Table implements Serializable {
private UUID tableId;
private UUID roomId;
private String name;
private String controllerName;
private String gameType;
private Seat[] seats;
private int numSeats;
@ -59,23 +61,25 @@ public class Table implements Serializable {
protected TableEventSource tableEventSource = new TableEventSource();
public Table(String gameType, String name, DeckValidator validator, List<String> playerTypes, Tournament tournament) {
this(gameType, name, validator, playerTypes);
public Table(UUID roomId, String gameType, String name, String controllerName, DeckValidator validator, List<String> playerTypes, Tournament tournament) {
this(roomId, gameType, name, controllerName, validator, playerTypes);
this.tournament = tournament;
this.isTournament = true;
}
public Table(String gameType, String name, DeckValidator validator, List<String> playerTypes, Match match) {
this(gameType, name, validator, playerTypes);
public Table(UUID roomId, String gameType, String name, String controllerName, DeckValidator validator, List<String> playerTypes, Match match) {
this(roomId, gameType, name, controllerName, validator, playerTypes);
this.match = match;
this.isTournament = false;
}
protected Table(String gameType, String name, DeckValidator validator, List<String> playerTypes) {
protected Table(UUID roomId, String gameType, String name, String controllerName, DeckValidator validator, List<String> playerTypes) {
tableId = UUID.randomUUID();
this.roomId = roomId;
this.numSeats = playerTypes.size();
this.gameType = gameType;
this.name = name;
this.controllerName = controllerName;
createSeats(playerTypes);
this.validator = validator;
}
@ -93,6 +97,10 @@ public class Table implements Serializable {
return tableId;
}
public UUID getRoomId() {
return roomId;
}
public void initGame() {
state = TableState.DUELING;
}
@ -194,4 +202,8 @@ public class Table implements Serializable {
return tournament;
}
public String getControllerName() {
return controllerName;
}
}