forked from External/mage
changes to support multiplayer
This commit is contained in:
parent
7d27c06329
commit
313ff97119
5 changed files with 123 additions and 13 deletions
|
|
@ -48,6 +48,8 @@ public class PlayerView implements Serializable {
|
|||
private int life;
|
||||
private int libraryCount;
|
||||
private int handCount;
|
||||
private boolean isActive;
|
||||
private boolean hasLeft;
|
||||
private ManaPoolView manaPool;
|
||||
private CardsView graveyard = new CardsView();
|
||||
private Map<UUID, PermanentView> battlefield = new HashMap<UUID, PermanentView>();
|
||||
|
|
@ -59,6 +61,8 @@ public class PlayerView implements Serializable {
|
|||
this.libraryCount = player.getLibrary().size();
|
||||
this.handCount = player.getHand().size();
|
||||
this.manaPool = new ManaPoolView(player.getManaPool());
|
||||
this.isActive = (player.getId().equals(game.getActivePlayerId()));
|
||||
this.hasLeft = player.hasLeft();
|
||||
for (Card card: player.getGraveyard().values()) {
|
||||
graveyard.add(new CardView(card));
|
||||
}
|
||||
|
|
@ -69,35 +73,42 @@ public class PlayerView implements Serializable {
|
|||
}
|
||||
|
||||
public int getLife() {
|
||||
return life;
|
||||
return this.life;
|
||||
}
|
||||
|
||||
public int getLibraryCount() {
|
||||
return libraryCount;
|
||||
return this.libraryCount;
|
||||
}
|
||||
|
||||
public int getHandCount() {
|
||||
return handCount;
|
||||
return this.handCount;
|
||||
}
|
||||
|
||||
public ManaPoolView getManaPool() {
|
||||
return manaPool;
|
||||
return this.manaPool;
|
||||
}
|
||||
|
||||
public CardsView getGraveyard() {
|
||||
return graveyard;
|
||||
return this.graveyard;
|
||||
}
|
||||
|
||||
public Map<UUID, PermanentView> getBattlefield() {
|
||||
return battlefield;
|
||||
return this.battlefield;
|
||||
}
|
||||
|
||||
public UUID getPlayerId() {
|
||||
return playerId;
|
||||
return this.playerId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public boolean isActive() {
|
||||
return this.isActive;
|
||||
}
|
||||
|
||||
public boolean hasLeft() {
|
||||
return this.hasLeft;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue