From 62bb720ea707765e2a33a03ee5dfa91b753123e8 Mon Sep 17 00:00:00 2001 From: Eduardo Pedroni Date: Fri, 5 Jun 2015 21:50:36 +0200 Subject: Tidied up README and help, sorted out a neater Ant build script --- src/eu/equalparts/cardbase/data/CardBase.java | 24 ---------------------- .../equalparts/cardbase/data/CardBaseManager.java | 4 ++-- src/eu/equalparts/cardbase/data/Cardbase.java | 24 ++++++++++++++++++++++ 3 files changed, 26 insertions(+), 26 deletions(-) delete mode 100644 src/eu/equalparts/cardbase/data/CardBase.java create mode 100644 src/eu/equalparts/cardbase/data/Cardbase.java (limited to 'src/eu/equalparts/cardbase/data') diff --git a/src/eu/equalparts/cardbase/data/CardBase.java b/src/eu/equalparts/cardbase/data/CardBase.java deleted file mode 100644 index abdd423..0000000 --- a/src/eu/equalparts/cardbase/data/CardBase.java +++ /dev/null @@ -1,24 +0,0 @@ -package eu.equalparts.cardbase.data; - -import java.util.ArrayList; - -public class CardBase { - - public ArrayList cards = new ArrayList<>(); - public ArrayList decks = new ArrayList<>(); - - /** - * @param setCode - * @param number - * @return the card if found, else null. - */ - public Card getCardByNumber(String setCode, String number) { - for (Card card : cards) { - if (card.setCode.equals(setCode) && card.number.equals(number)) - return card; - } - - return null; - } - -} diff --git a/src/eu/equalparts/cardbase/data/CardBaseManager.java b/src/eu/equalparts/cardbase/data/CardBaseManager.java index 0baf9d7..d6a63dc 100644 --- a/src/eu/equalparts/cardbase/data/CardBaseManager.java +++ b/src/eu/equalparts/cardbase/data/CardBaseManager.java @@ -12,7 +12,7 @@ import eu.equalparts.cardbase.query.IO; public class CardBaseManager { private ArrayList metaSets; - public CardBase cardBase; + public Cardbase cardBase; /** * Parse a cardbase file and create an associated CardBase object. @@ -33,7 +33,7 @@ public class CardBaseManager { */ public CardBaseManager() throws JsonParseException, JsonMappingException, IOException { metaSets = IO.getAllMetaSets(); - cardBase = new CardBase(); + cardBase = new Cardbase(); } public ArrayList getAllMetaSets() { diff --git a/src/eu/equalparts/cardbase/data/Cardbase.java b/src/eu/equalparts/cardbase/data/Cardbase.java new file mode 100644 index 0000000..1c2aa12 --- /dev/null +++ b/src/eu/equalparts/cardbase/data/Cardbase.java @@ -0,0 +1,24 @@ +package eu.equalparts.cardbase.data; + +import java.util.ArrayList; + +public class Cardbase { + + public ArrayList cards = new ArrayList<>(); + public ArrayList decks = new ArrayList<>(); + + /** + * @param setCode + * @param number + * @return the card if found, else null. + */ + public Card getCardByNumber(String setCode, String number) { + for (Card card : cards) { + if (card.setCode.equals(setCode) && card.number.equals(number)) + return card; + } + + return null; + } + +} -- cgit v1.2.3