Displaying not implemented cards for M12.

This commit is contained in:
magenoxx 2011-07-31 09:51:42 +04:00
parent 7e45f77c22
commit 8be91072de
3 changed files with 17 additions and 3 deletions

View file

@ -175,6 +175,7 @@ public class CardsStorage {
readUnimplemented("SOM", "/som.txt", names, cards);
readUnimplemented("MBS", "/mbs.txt", names, cards);
readUnimplemented("NPH", "/nph.txt", names, cards);
readUnimplemented("M12", "/m12.txt", names, cards);
names.clear();
names = null;
@ -206,6 +207,18 @@ public class CardsStorage {
card.getCardType().clear();
cards.add(card);
}
} else { // for m12 and further
String name = s[0].trim();
if (!names.contains(set + name)) {
Integer cid = Integer.parseInt(s[2]);
Card card = tmp.copy();
card.setName(name);
card.setExpansionSetCode(set);
card.setCardNumber(cid);
card.setRarity(Constants.Rarity.NA); // mark as not implemented
card.getCardType().clear();
cards.add(card);
}
}
}
} catch (Exception e) {
@ -232,7 +245,7 @@ public class CardsStorage {
* @author nantuko
*/
private static class CardComparator implements Comparator<Card> {
private static final String LATEST_SET_CODE = "NPH";
private static final String LATEST_SET_CODE = "M12";
@Override
public int compare(Card o1, Card o2) {
@ -273,6 +286,7 @@ public class CardsStorage {
latestSetCodes.add("SOM");
latestSetCodes.add("MBS");
latestSetCodes.add("NPH");
latestSetCodes.add("M12");
}
@Override

View file

@ -305,7 +305,7 @@ public class MageBook extends JComponent {
private HoverButton pageRight;
private int currentPage = 0;
private String currentSet = "NPH";
private String currentSet = "M12";
private static CardDimensions cardDimensions = new CardDimensions(1.2d);
private static final Logger log = Logger.getLogger(MageBook.class);

View file

@ -364,7 +364,7 @@ public class Mana implements Comparable<Mana>, Serializable, Copyable<Mana> {
/**
*
* @param netMana
* @param mana
* @return true if this contains any values that mana has
*/
public boolean contains(Mana mana) {