mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 20:58:03 +00:00
CardFace prettifying
This commit is contained in:
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -13638,7 +13638,7 @@ src/main/java/forge/card/CardBlock.java -text
|
|||||||
src/main/java/forge/card/CardCharacteristics.java -text
|
src/main/java/forge/card/CardCharacteristics.java -text
|
||||||
src/main/java/forge/card/CardCoreType.java -text
|
src/main/java/forge/card/CardCoreType.java -text
|
||||||
src/main/java/forge/card/CardEdition.java -text
|
src/main/java/forge/card/CardEdition.java -text
|
||||||
src/main/java/forge/card/CardFaceRules.java -text
|
src/main/java/forge/card/CardFace.java -text
|
||||||
src/main/java/forge/card/CardInSet.java -text
|
src/main/java/forge/card/CardInSet.java -text
|
||||||
src/main/java/forge/card/CardRarity.java -text
|
src/main/java/forge/card/CardRarity.java -text
|
||||||
src/main/java/forge/card/CardRules.java -text
|
src/main/java/forge/card/CardRules.java -text
|
||||||
|
|||||||
@@ -16,10 +16,11 @@ import forge.card.mana.ManaCost;
|
|||||||
//
|
//
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: Write javadoc for this type.
|
* Represents a single side or part of a magic card with its original characteristics.
|
||||||
*
|
* <br><br>
|
||||||
|
* <i>Do not use reference to class except for card parsing.<br>Always use reference to interface type outside of package.</i>
|
||||||
*/
|
*/
|
||||||
final class CardFaceRules implements ICardCharacteristics {
|
final class CardFace implements ICardCharacteristics {
|
||||||
|
|
||||||
private final String name;
|
private final String name;
|
||||||
private CardType type = null;
|
private CardType type = null;
|
||||||
@@ -41,17 +42,20 @@ final class CardFaceRules implements ICardCharacteristics {
|
|||||||
@Override public final int getIntToughness() { return iToughness; }
|
@Override public final int getIntToughness() { return iToughness; }
|
||||||
@Override public final String getPower() { return power; }
|
@Override public final String getPower() { return power; }
|
||||||
@Override public final String getToughness() { return toughness; }
|
@Override public final String getToughness() { return toughness; }
|
||||||
@Override public int getInitialLoyalty() { return initialLoyalty; }
|
@Override public int getInitialLoyalty() { return initialLoyalty; }
|
||||||
@Override public final String getName() { return this.name; }
|
@Override public final String getName() { return this.name; }
|
||||||
@Override public final CardType getType() { return this.type; }
|
@Override public final CardType getType() { return this.type; }
|
||||||
@Override public final ManaCost getManaCost() { return this.manaCost; }
|
@Override public final ManaCost getManaCost() { return this.manaCost; }
|
||||||
@Override public final ColorSet getColor() { return this.color; }
|
@Override public final ColorSet getColor() { return this.color; }
|
||||||
@Override public final Iterable<String> getKeywords() { return keywords; }
|
@Override public final Iterable<String> getKeywords() { return keywords; }
|
||||||
|
|
||||||
|
|
||||||
|
public CardFace(String name0) {
|
||||||
|
this.name = name0;
|
||||||
|
if ( StringUtils.isBlank(name0) )
|
||||||
|
throw new RuntimeException("Card name is empty");
|
||||||
|
}
|
||||||
// Here come setters to allow parser supply values
|
// Here come setters to allow parser supply values
|
||||||
public CardFaceRules(String name0) { this.name = name0; if ( StringUtils.isBlank(name0) ) throw new RuntimeException("Card name is empty"); }
|
|
||||||
|
|
||||||
public final void setType(CardType type0) { this.type = type0; }
|
public final void setType(CardType type0) { this.type = type0; }
|
||||||
public final void setManaCost(ManaCost manaCost0) { this.manaCost = manaCost0; }
|
public final void setManaCost(ManaCost manaCost0) { this.manaCost = manaCost0; }
|
||||||
public final void setColor(ColorSet color0) { this.color = color0; }
|
public final void setColor(ColorSet color0) { this.color = color0; }
|
||||||
@@ -78,7 +82,7 @@ final class CardFaceRules implements ICardCharacteristics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// This should not be here
|
// This should not be here, but I don't know a better place yet
|
||||||
private final Map<String, CardInSet> setsPrinted = new TreeMap<String, CardInSet>(String.CASE_INSENSITIVE_ORDER);
|
private final Map<String, CardInSet> setsPrinted = new TreeMap<String, CardInSet>(String.CASE_INSENSITIVE_ORDER);
|
||||||
@Override public Set<Entry<String, CardInSet>> getSetsPrinted() { return this.setsPrinted.entrySet(); }
|
@Override public Set<Entry<String, CardInSet>> getSetsPrinted() { return this.setsPrinted.entrySet(); }
|
||||||
@Override public CardInSet getEditionInfo(final String setCode) {
|
@Override public CardInSet getEditionInfo(final String setCode) {
|
||||||
@@ -41,7 +41,7 @@ public class CardRulesReader {
|
|||||||
// fields to build
|
// fields to build
|
||||||
private List<String> originalScript = new ArrayList<String>();
|
private List<String> originalScript = new ArrayList<String>();
|
||||||
|
|
||||||
private CardFaceRules[] faces = new CardFaceRules[] { null, null };
|
private CardFace[] faces = new CardFace[] { null, null };
|
||||||
private String[] pictureUrl = new String[] { null, null };
|
private String[] pictureUrl = new String[] { null, null };
|
||||||
private int curFace = 0;
|
private int curFace = 0;
|
||||||
private CardSplitType altMode;
|
private CardSplitType altMode;
|
||||||
@@ -163,7 +163,7 @@ public class CardRulesReader {
|
|||||||
|
|
||||||
case 'N':
|
case 'N':
|
||||||
if ("Name".equals(key)) {
|
if ("Name".equals(key)) {
|
||||||
this.faces[this.curFace] = new CardFaceRules(value);
|
this.faces[this.curFace] = new CardFace(value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user