aboutsummaryrefslogtreecommitdiffstats
path: root/test/Testest.java
diff options
context:
space:
mode:
authorEduardo Pedroni <e.pedroni91@gmail.com>2015-06-28 12:51:11 +0200
committerEduardo Pedroni <e.pedroni91@gmail.com>2015-06-28 12:51:11 +0200
commitcd6a5c077874ac6baacc8b073195aaea81a1e247 (patch)
tree995a922ff323c445d82f7af9ee4dba53c591115c /test/Testest.java
parentbf29c3d96160eeaa64f60a512a0a9f4d7c85167a (diff)
Made good progress with introspective sort, fixed ant build issue, ant builds are now done on a different bin directory
Diffstat (limited to 'test/Testest.java')
-rw-r--r--test/Testest.java54
1 files changed, 54 insertions, 0 deletions
diff --git a/test/Testest.java b/test/Testest.java
new file mode 100644
index 0000000..016cbf4
--- /dev/null
+++ b/test/Testest.java
@@ -0,0 +1,54 @@
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import com.fasterxml.jackson.core.JsonParseException;
+import com.fasterxml.jackson.core.type.TypeReference;
+import com.fasterxml.jackson.databind.JsonMappingException;
+
+import eu.equalparts.cardbase.data.Card;
+import eu.equalparts.cardbase.utils.JSON;
+
+
+public class Testest {
+
+
+ public static class FullCardSet {
+
+ public String name;
+ public String code;
+ public String magicCardsInfoCode;
+ public String releaseDate;
+ public String border;
+ public String type;
+ public String block;
+ public String gathererCode;
+ public List<Card> cards;
+
+ public FullCardSet() {}
+ }
+
+
+ public static void main(String... args) throws JsonParseException, JsonMappingException, MalformedURLException, IOException {
+ Map<String, FullCardSet> setMap = JSON.mapper.readValue(new File("./AllSets.json"), new TypeReference<Map<String, FullCardSet>> () {});
+
+ List<String> rarities = new ArrayList<String>();
+
+ int count = 0;
+
+ for (FullCardSet cardSet : setMap.values()) {
+ for (Card card : cardSet.cards) {
+ count++;
+ if (!rarities.contains(card.rarity)) {
+ rarities.add(card.rarity);
+ System.out.println(card.rarity);
+ }
+ }
+ }
+
+ System.out.println("Done, " + count + " cards looked at.");
+ }
+}