Added Portal Three Kingdoms set to Mage.

This commit is contained in:
LevelX2 2014-02-19 19:47:08 +01:00
parent 8b455aca40
commit 90d75a65a7
5 changed files with 80 additions and 11 deletions

View file

@ -51,6 +51,7 @@ public class ConstructedFormats {
"* Ice Age Block", "Coldsnap", "Alliances", "Ice Age", "Fourth Edition",
"Homelands", "Fallen Empires", "The Dark", "Legends", "Antiquities", "Arabian Nights",
"Revised Edition", "Unlimited Edition", "Limited Edition Beta", "Limited Edition Alpha",
"Portal Three Kingdoms",
"Guru",
"Duel Decks: Heroes vs. Monsters",
"Duel Decks: Elspeth vs. Tezzeret"
@ -387,6 +388,9 @@ public class ConstructedFormats {
if (format.equals("Guru")) {
return Arrays.asList("GUR");
}
if (format.equals("Portal Three Kingdoms")) {
return Arrays.asList("PTK");
}
if (format.equals("Duel Decks: Elspeth vs. Tezzeret")) {
return Arrays.asList("DDF");
}
@ -422,17 +426,17 @@ public class ConstructedFormats {
}
}
private static final List<String> standard = new ArrayList<String>();
private static final List<String> standard = new ArrayList<>();
private static final Date standardDate = new GregorianCalendar(2012, 9, 28).getTime();
private static final List<String> extended = new ArrayList<String>();
private static final List<String> extended = new ArrayList<>();
private static final Date extendedDate = new GregorianCalendar(2009, 8, 20).getTime();
private static final List<String> modern = new ArrayList<String>();
private static final List<String> modern = new ArrayList<>();
private static final Date modernDate = new GregorianCalendar(2003, 7, 20).getTime();
// for all sets just return empty list
private static final List<String> all = new ArrayList<String>();
private static final List<String> all = new ArrayList<>();
static {
buildLists();

View file

@ -30,7 +30,8 @@ public class GathererSets implements Iterable<DownloadJob> {
"RAV", "GPT", "DIS",
"TSP", "TSB", "PLC", "FUT",
"LRW", "MOR",
"SHM", "EVE"};
"SHM", "EVE",
"PTK"};
private static final String[] withMythics = {"M10", "M11", "M12", "M13", "M14",
"DDF", "DDL",
@ -42,7 +43,7 @@ public class GathererSets implements Iterable<DownloadJob> {
"RTR", "GTC", "DGM",
"MMA",
"THS", "BNG"};
private static final HashMap<String, String> symbolsReplacements = new HashMap<String, String>();
private static final HashMap<String, String> symbolsReplacements = new HashMap<>();
static {
symbolsReplacements.put("ARN", "AN");
@ -89,7 +90,7 @@ public class GathererSets implements Iterable<DownloadJob> {
@Override
public Iterator<DownloadJob> iterator() {
ArrayList<DownloadJob> jobs = new ArrayList<DownloadJob>();
ArrayList<DownloadJob> jobs = new ArrayList<>();
for (String symbol : symbols) {
jobs.add(generateDownloadJob(symbol, "C"));
jobs.add(generateDownloadJob(symbol, "U"));

View file

@ -58,6 +58,7 @@ public class MagicCardsImageSource implements CardImageSource {
put("10E", "tenth-edition");
put("CSP", "coldsnap");
put("CHK", "player-rewards-2004");
put("PTK", "portal-three-kingdoms");
}
private static final long serialVersionUID = 1L;
};

View file

@ -17,7 +17,7 @@ public class WizardCardsImageSource implements CardImageSource {
private static CardImageSource instance;
private static Map<String, String> setsAliases;
private Map<String, Map<String, String>> sets;
private final Map<String, Map<String, String>> sets;
public static CardImageSource getInstance() {
if (instance == null) {
@ -27,8 +27,8 @@ public class WizardCardsImageSource implements CardImageSource {
}
public WizardCardsImageSource() {
sets = new HashMap<String, Map<String, String>>();
setsAliases = new HashMap<String, String>();
sets = new HashMap<>();
setsAliases = new HashMap<>();
setsAliases.put("BNG", "bornofthegods/cig");
setsAliases.put("C13", "commander2013/cig");
setsAliases.put("THS", "theros/cig");
@ -55,10 +55,11 @@ public class WizardCardsImageSource implements CardImageSource {
setsAliases.put("CON", "conflux/spoiler");
setsAliases.put("ALA", "shardsofalara/spoiler");
setsAliases.put("PC2", "planechase2012edition/cig");
setsAliases.put("PTK", "portalthreekingdoms/cig");
}
private Map<String, String> getSetLinks(String cardSet) {
Map<String, String> setLinks = new HashMap<String, String>();
Map<String, String> setLinks = new HashMap<>();
try {
Document doc = Jsoup.connect("http://www.wizards.com/magic/tcg/article.aspx?x=mtg/tcg/" + setsAliases.get(cardSet)).get();
Elements cardsImages = doc.select("img[height$=370]");