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

@ -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]");