mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
isCardSupported has been implemented on CardDb basis
This commit is contained in:
@@ -98,6 +98,9 @@ public final class CardDb {
|
|||||||
uniqueCards.put(cardName, lastAdded);
|
uniqueCards.put(cardName, lastAdded);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isCardSupported(final String cardName) { return uniqueCards.containsKey(cardName.toLowerCase()); }
|
||||||
|
|
||||||
|
|
||||||
// Single fetch
|
// Single fetch
|
||||||
public CardPrinted getCard(final String name) {
|
public CardPrinted getCard(final String name) {
|
||||||
// Sometimes they read from decks things like "CardName|Set" - but we can handle it
|
// Sometimes they read from decks things like "CardName|Set" - but we can handle it
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package forge.deck;
|
|||||||
|
|
||||||
import forge.AllZone;
|
import forge.AllZone;
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
|
import forge.card.CardDb;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>DownloadDeck class.</p>
|
* <p>DownloadDeck class.</p>
|
||||||
@@ -141,15 +142,10 @@ public class DownloadDeck {
|
|||||||
* @param CardName a {@link java.lang.String} object.
|
* @param CardName a {@link java.lang.String} object.
|
||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public boolean isCardSupport(String CardName) {
|
public boolean isCardSupport(String cardName) {
|
||||||
// TODO: using AllZone.getCardFactory().getCard() would probably be much faster.
|
// TODO: using AllZone.getCardFactory().getCard() would probably be much faster.
|
||||||
|
|
||||||
for (Card gCard : AllZone.getCardFactory()) {
|
return CardDb.instance().isCardSupported(cardName);
|
||||||
if (CardName.equalsIgnoreCase(gCard.getName())) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user