mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
Fixes #492 : Tarmogoyf p/t stats are not displayed in hand
This commit is contained in:
parent
b9618a2074
commit
58e4c66af6
4 changed files with 9 additions and 16 deletions
|
@ -458,7 +458,7 @@ public final class GamePanel extends javax.swing.JPanel {
|
|||
this.handContainer.setVisible(false);
|
||||
} else {
|
||||
handCards.clear();
|
||||
handCards.put(YOUR_HAND, CardsViewUtil.convertSimple(game.getHand(), loadedCards));
|
||||
handCards.put(YOUR_HAND, game.getHand());
|
||||
|
||||
// Mark playable
|
||||
if (game.getCanPlayInHand() != null) {
|
||||
|
|
|
@ -35,10 +35,7 @@ import mage.abilities.SpellAbility;
|
|||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.SplitCard;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.MageObjectType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.constants.*;
|
||||
import mage.counters.Counter;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.command.Emblem;
|
||||
|
@ -53,7 +50,6 @@ import mage.target.Targets;
|
|||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.constants.AbilityType;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
@ -196,24 +192,21 @@ public class CardView extends SimpleCardView {
|
|||
if (card instanceof Permanent) {
|
||||
this.mageObjectType = MageObjectType.PERMANENT;
|
||||
Permanent permanent = (Permanent)card;
|
||||
this.power = Integer.toString(card.getPower().getValue());
|
||||
this.toughness = Integer.toString(card.getToughness().getValue());
|
||||
this.loyalty = Integer.toString(permanent.getCounters().getCount(CounterType.LOYALTY));
|
||||
this.pairedCard = permanent.getPairedCard();
|
||||
if (!permanent.getControllerId().equals(permanent.getOwnerId())) {
|
||||
controlledByOwner = false;
|
||||
}
|
||||
} else {
|
||||
|
||||
if (card.isCopy()) {
|
||||
this.mageObjectType = MageObjectType.COPY_CARD;
|
||||
} else {
|
||||
this.mageObjectType = MageObjectType.CARD;
|
||||
}
|
||||
this.power = card.getPower().toString();
|
||||
this.toughness = card.getToughness().toString();
|
||||
this.loyalty = "";
|
||||
}
|
||||
this.power = Integer.toString(card.getPower().getValue());
|
||||
this.toughness = Integer.toString(card.getToughness().getValue());
|
||||
this.cardTypes = card.getCardType();
|
||||
this.subTypes = card.getSubtype();
|
||||
this.superTypes = card.getSupertype();
|
||||
|
|
|
@ -45,10 +45,10 @@ import mage.game.stack.Spell;
|
|||
import mage.game.stack.StackAbility;
|
||||
import mage.game.stack.StackObject;
|
||||
import mage.players.Player;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.*;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -62,7 +62,7 @@ public class GameView implements Serializable {
|
|||
|
||||
private final int priorityTime;
|
||||
private final List<PlayerView> players = new ArrayList<>();
|
||||
private SimpleCardsView hand;
|
||||
private CardsView hand;
|
||||
private Set<UUID> canPlayInHand;
|
||||
private Map<String, SimpleCardsView> opponentHands;
|
||||
private final CardsView stack = new CardsView();
|
||||
|
@ -206,11 +206,11 @@ public class GameView implements Serializable {
|
|||
return players;
|
||||
}
|
||||
|
||||
public SimpleCardsView getHand() {
|
||||
public CardsView getHand() {
|
||||
return hand;
|
||||
}
|
||||
|
||||
public void setHand(SimpleCardsView hand) {
|
||||
public void setHand(CardsView hand) {
|
||||
this.hand = hand;
|
||||
}
|
||||
|
||||
|
|
|
@ -235,7 +235,7 @@ public class GameSession extends GameWatcher {
|
|||
Player player = game.getPlayer(playerId);
|
||||
player.setUserData(this.userData);
|
||||
GameView gameView = new GameView(game.getState(), game, playerId);
|
||||
gameView.setHand(new SimpleCardsView(player.getHand().getCards(game)));
|
||||
gameView.setHand(new CardsView(player.getHand().getCards(game)));
|
||||
gameView.setCanPlayInHand(player.getPlayableInHand(game));
|
||||
|
||||
processControlledPlayers(player, gameView);
|
||||
|
|
Loading…
Reference in a new issue