Added frameStyle Characteristic for cards

* Added FrameStyle Enum containing a list of styles that cards can be rendered in.

* Added getFrameStyle() getter to Card interface.

* Implemented getFrameStyle() for various concrete implementations of Card.
This commit is contained in:
Mark Langen 2016-09-06 21:50:04 -06:00
parent 0ea9d33211
commit b549dfe0dc
12 changed files with 115 additions and 3 deletions

View file

@ -0,0 +1,58 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.cards;
/**
*
* @author StravantUser
*/
public enum FrameStyle {
/**
* The default card frame, normal M15 card frames
*/
M15_NORMAL(BorderType.M15, false),
/**
* Battle for Zendkiar full art basic lands
*/
BFZ_FULL_ART_BASIC(BorderType.M15, true);
/**
* General type of card
*/
public enum BorderType {
/**
* Old border cards
*/
OLD,
/**
* Modern border cards (8th -> Theros)
*/
MOD,
/**
* M15 border cards (M14 -> current)
*/
M15
}
private BorderType borderType;
private boolean isFullArt;
public BorderType getBorderType() {
return borderType;
}
public boolean isFullArt() {
return isFullArt;
}
FrameStyle(BorderType borderType, boolean isFullArt) {
this.borderType = borderType;
this.isFullArt = isFullArt;
}
}

View file

@ -30,6 +30,7 @@ public class MockCard extends CardImpl {
this.subtype = card.getSubTypes();
this.supertype = card.getSupertypes();
this.usesVariousArt = card.usesVariousArt();
this.manaCost = new ManaCostsImpl(join(card.getManaCosts()));
@ -37,6 +38,7 @@ public class MockCard extends CardImpl {
this.color = card.getColor();
this.frameColor = card.getFrameColor();
this.frameStyle = card.getFrameStyle();
this.splitCard = card.isSplitCard();
this.flipCard = card.isFlipCard();

View file

@ -36,6 +36,7 @@ import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import mage.cards.FrameStyle;
import mage.constants.CardType;
import mage.constants.Rarity;
import mage.ObjectColor;
@ -100,6 +101,8 @@ public class CardInfo {
@DatabaseField
protected String frameColor;
@DatabaseField
protected String frameStyle;
@DatabaseField
protected boolean splitCard;
@DatabaseField
protected boolean splitCardHalf;
@ -138,6 +141,7 @@ public class CardInfo {
this.secondSideName = secondSide.getName();
}
this.frameStyle = card.getFrameStyle().toString();
this.frameColor = card.getFrameColor(null).toString();
this.blue = card.getColor(null).isBlue();
this.black = card.getColor(null).isBlack();
@ -227,6 +231,10 @@ public class CardInfo {
return new ObjectColor(frameColor);
}
public FrameStyle getFrameStyle() {
return FrameStyle.valueOf(this.frameStyle);
}
private String joinList(List<String> items) {
StringBuilder sb = new StringBuilder();
for (Object item : items) {

View file

@ -62,16 +62,16 @@ public enum CardRepository {
private static final String JDBC_URL = "jdbc:h2:file:./db/cards.h2;AUTO_SERVER=TRUE";
private static final String VERSION_ENTITY_NAME = "card";
// raise this if db structure was changed
private static final long CARD_DB_VERSION = 46;
private static final long CARD_DB_VERSION = 47;
// raise this if new cards were added to the server
private static final long CARD_CONTENT_VERSION = 57;
private static final long CARD_CONTENT_VERSION = 58;
private Dao<CardInfo, Object> cardDao;
private Set<String> classNames;
private final TreeSet<String> landTypes = new TreeSet();
private CardRepository() {
CardRepository() {
File file = new File("db");
if (!file.exists()) {
file.mkdirs();