mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
Redesigned handling of various art for cards.
This commit is contained in:
parent
96738632d1
commit
4b2e6a8bc0
15 changed files with 82 additions and 49 deletions
|
|
@ -47,7 +47,6 @@ import java.util.ArrayList;
|
|||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Mode;
|
||||
import mage.game.permanent.PermanentCard;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
|
|
@ -87,10 +86,7 @@ public class CardView extends SimpleCardView {
|
|||
}
|
||||
|
||||
public CardView(Card card) {
|
||||
super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(),
|
||||
(card instanceof PermanentCard ?
|
||||
Character.isDigit(((PermanentCard) card).getCard().getClass().getName().charAt(((PermanentCard) card).getCard().getClass().getName().length()-1))
|
||||
:Character.isDigit(card.getClass().getName().charAt(card.getClass().getName().length()-1))));
|
||||
super(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), card.getUsesVariousArt());
|
||||
|
||||
// no information available for face down cards
|
||||
if (this.faceDown) {
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ public class ExileView extends SimpleCardsView {
|
|||
this.name = exileZone.getName();
|
||||
this.id = exileZone.getId();
|
||||
for (Card card: exileZone.getCards(game)) {
|
||||
this.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), Character.isDigit(card.getClass().getName().charAt(card.getClass().getName().length()-1))));
|
||||
this.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), card.getUsesVariousArt()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class LookedAtView implements Serializable {
|
|||
public LookedAtView(String name, Cards cards, Game game) {
|
||||
this.name = name;
|
||||
for (Card card: cards.getCards(game)) {
|
||||
this.cards.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), Character.isDigit(card.getClass().getName().charAt(card.getClass().getName().length()-1)), card.isFaceDown()));
|
||||
this.cards.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.isFaceDown()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ public class PlayerView implements Serializable {
|
|||
this.isActive = (player.getId().equals(state.getActivePlayerId()));
|
||||
this.hasLeft = player.hasLeft();
|
||||
for (Card card: player.getGraveyard().getCards(game)) {
|
||||
graveyard.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), Character.isDigit(card.getClass().getName().charAt(card.getClass().getName().length()-1)), card.isFaceDown()));
|
||||
graveyard.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.isFaceDown()));
|
||||
}
|
||||
for (Permanent permanent: state.getBattlefield().getAllPermanents()) {
|
||||
if (showInBattlefield(permanent, state)) {
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ public class RevealedView implements Serializable {
|
|||
public RevealedView(String name, Cards cards, Game game) {
|
||||
this.name = name;
|
||||
for (Card card: cards.getCards(game)) {
|
||||
this.cards.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), Character.isDigit(card.getClass().getName().charAt(card.getClass().getName().length()-1)), card.isFaceDown()));
|
||||
this.cards.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.getUsesVariousArt(), card.isFaceDown()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -40,14 +40,14 @@ public class SimpleCardView implements Serializable {
|
|||
protected String expansionSetCode;
|
||||
protected int cardNumber;
|
||||
protected boolean faceDown;
|
||||
protected boolean useCardNumber; // for building the image name (different images for the same card)
|
||||
protected boolean usesVariousArt;
|
||||
|
||||
public SimpleCardView(UUID id, String expansionSetCode, int cardNumber, boolean faceDown, boolean useCardNumber) {
|
||||
public SimpleCardView(UUID id, String expansionSetCode, int cardNumber, boolean faceDown, boolean usesVariousArt) {
|
||||
this.id = id;
|
||||
this.expansionSetCode = expansionSetCode;
|
||||
this.cardNumber = cardNumber;
|
||||
this.faceDown = faceDown;
|
||||
this.useCardNumber = useCardNumber;
|
||||
this.usesVariousArt = usesVariousArt;
|
||||
}
|
||||
|
||||
public UUID getId() {
|
||||
|
|
@ -66,7 +66,7 @@ public class SimpleCardView implements Serializable {
|
|||
return faceDown;
|
||||
}
|
||||
|
||||
public boolean useCardNumber() {
|
||||
return useCardNumber;
|
||||
public boolean getUsesVariousArt() {
|
||||
return usesVariousArt;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class SimpleCardsView extends LinkedHashMap<UUID, SimpleCardView> {
|
|||
|
||||
public SimpleCardsView(Collection<Card> cards) {
|
||||
for (Card card: cards) {
|
||||
this.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), Character.isDigit(card.getClass().getName().charAt(card.getClass().getName().length()-1))));
|
||||
this.put(card.getId(), new SimpleCardView(card.getId(), card.getExpansionSetCode(), card.getCardNumber(), card.isFaceDown(), card.getUsesVariousArt()));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue