forked from External/mage
* Added possibility to allow other players to see hand cards of player.
This commit is contained in:
parent
d0e1107a3e
commit
7e145d2cfd
33 changed files with 1093 additions and 190 deletions
|
|
@ -65,6 +65,7 @@ public class GameView implements Serializable {
|
|||
private CardsView hand;
|
||||
private Set<UUID> canPlayInHand;
|
||||
private Map<String, SimpleCardsView> opponentHands;
|
||||
private Map<String, SimpleCardsView> watchedHands;
|
||||
private final CardsView stack = new CardsView();
|
||||
private final List<ExileView> exiles = new ArrayList<>();
|
||||
private final List<RevealedView> revealed = new ArrayList<>();
|
||||
|
|
@ -80,11 +81,11 @@ public class GameView implements Serializable {
|
|||
private final boolean isPlayer;
|
||||
|
||||
|
||||
public GameView(GameState state, Game game, UUID createdForPlayerId) {
|
||||
public GameView(GameState state, Game game, UUID createdForPlayerId, UUID watcherUserId) {
|
||||
this.isPlayer = createdForPlayerId != null;
|
||||
this.priorityTime = game.getPriorityTime();
|
||||
for (Player player: state.getPlayers().values()) {
|
||||
players.add(new PlayerView(player, state, game, createdForPlayerId));
|
||||
players.add(new PlayerView(player, state, game, createdForPlayerId, watcherUserId));
|
||||
}
|
||||
for (StackObject stackObject: state.getStack()) {
|
||||
if (stackObject instanceof StackAbility) {
|
||||
|
|
@ -222,6 +223,14 @@ public class GameView implements Serializable {
|
|||
this.opponentHands = opponentHands;
|
||||
}
|
||||
|
||||
public Map<String, SimpleCardsView> getWatchedHands() {
|
||||
return watchedHands;
|
||||
}
|
||||
|
||||
public void setWatchedHands(Map<String, SimpleCardsView> watchedHands) {
|
||||
this.watchedHands = watchedHands;
|
||||
}
|
||||
|
||||
public TurnPhase getPhase() {
|
||||
return phase;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue