forked from External/mage
Sending user data. Sending avatar to server on connect.
This commit is contained in:
parent
32d4d854f4
commit
bf1a49dd0b
27 changed files with 202 additions and 38 deletions
|
|
@ -58,6 +58,7 @@ public class PlayerView implements Serializable {
|
|||
private SimpleCardsView graveyard = new SimpleCardsView();
|
||||
private Map<UUID, PermanentView> battlefield = new HashMap<UUID, PermanentView>();
|
||||
private CardView topCard;
|
||||
private UserDataView userDataView;
|
||||
|
||||
public PlayerView(Player player, GameState state, Game game) {
|
||||
this.playerId = player.getId();
|
||||
|
|
@ -80,6 +81,11 @@ public class PlayerView implements Serializable {
|
|||
}
|
||||
this.topCard = player.isTopCardRevealed() && player.getLibrary().size() > 0 ?
|
||||
new CardView(player.getLibrary().getFromTop(game)) : null;
|
||||
if (player.getUserData() != null) {
|
||||
this.userDataView = new UserDataView(player.getUserData());
|
||||
} else {
|
||||
this.userDataView = new UserDataView(0);
|
||||
}
|
||||
}
|
||||
|
||||
private boolean showInBattlefield(Permanent permanent, GameState state) {
|
||||
|
|
@ -143,4 +149,8 @@ public class PlayerView implements Serializable {
|
|||
public CardView getTopCard() {
|
||||
return this.topCard;
|
||||
}
|
||||
|
||||
public UserDataView getUserData() {
|
||||
return this.userDataView;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue