forked from External/mage
server, refactor: added client side info about current table and parent table (tourney's sub-tables with matches);
This commit is contained in:
parent
bd7aaa34ee
commit
7916af0e52
21 changed files with 315 additions and 161 deletions
|
|
@ -9,49 +9,69 @@ import mage.cards.decks.Deck;
|
|||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
* @author BetaSteward_at_googlemail.com, JayDi85
|
||||
*/
|
||||
public class TableClientMessage implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private DeckView deck;
|
||||
private UUID roomId;
|
||||
private UUID tableId;
|
||||
private UUID currentTableId;
|
||||
private UUID parentTableId; // tourney uses sub-tables for matches
|
||||
private UUID gameId;
|
||||
private UUID playerId;
|
||||
private int time;
|
||||
private boolean flag = false;
|
||||
|
||||
public TableClientMessage(Deck deck, UUID tableId, int time) {
|
||||
public TableClientMessage() {
|
||||
}
|
||||
|
||||
public TableClientMessage withDeck(Deck deck) {
|
||||
this.deck = new DeckView(deck);
|
||||
this.tableId = tableId;
|
||||
this.time = time;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TableClientMessage(Deck deck, UUID tableId, int time, boolean flag) {
|
||||
this.deck = new DeckView(deck);
|
||||
this.tableId = tableId;
|
||||
this.time = time;
|
||||
this.flag = flag;
|
||||
}
|
||||
|
||||
public TableClientMessage(UUID gameId, UUID playerId) {
|
||||
this.gameId = gameId;
|
||||
this.playerId = playerId;
|
||||
}
|
||||
|
||||
public TableClientMessage(UUID roomId, UUID tableId, boolean flag) {
|
||||
public TableClientMessage withRoom(UUID roomId) {
|
||||
this.roomId = roomId;
|
||||
this.tableId = tableId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TableClientMessage withTime(int time) {
|
||||
this.time = time;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TableClientMessage withFlag(boolean flag) {
|
||||
this.flag = flag;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TableClientMessage withPlayer(UUID playerId) {
|
||||
this.playerId = playerId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TableClientMessage withTable(UUID currentTableId, UUID parentTableId) {
|
||||
this.currentTableId = currentTableId;
|
||||
this.parentTableId = parentTableId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public TableClientMessage withGame(UUID gameId) {
|
||||
this.gameId = gameId;
|
||||
return this;
|
||||
}
|
||||
|
||||
public DeckView getDeck() {
|
||||
return deck;
|
||||
}
|
||||
|
||||
public UUID getTableId() {
|
||||
return tableId;
|
||||
public UUID getCurrentTableId() {
|
||||
return currentTableId;
|
||||
}
|
||||
|
||||
public UUID getParentTableId() {
|
||||
return parentTableId;
|
||||
}
|
||||
|
||||
public UUID getRoomId() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue