download the json at runtime

This commit is contained in:
Neil Gentleman 2016-02-14 14:33:32 -08:00
parent 26b8b88963
commit 510f7a86b6
4 changed files with 73 additions and 33 deletions

View file

@ -1,20 +1,9 @@
package mage.verify;
import com.fasterxml.jackson.core.type.TypeReference;
import com.fasterxml.jackson.databind.ObjectMapper;
import java.io.IOException;
import java.util.List;
import java.util.Map;
class JsonSet {
static Map<String, JsonSet> loadAll() throws IOException {
return new ObjectMapper().readValue(
JsonSet.class.getResourceAsStream("AllSets.json"),
new TypeReference<Map<String, JsonSet>>() {});
}
public String name;
public String code;
public String oldCode;
@ -28,4 +17,7 @@ class JsonSet {
public List<JsonCard> cards;
public String block;
public boolean onlineOnly;
public String mkm_id;
public String mkm_name;
public Map<String, String> translations;
}