forked from External/mage
revert card scanner changes
This commit is contained in:
parent
0fc8d0871c
commit
97738afb9e
3 changed files with 8 additions and 16 deletions
|
|
@ -61,7 +61,7 @@ public final class RateCard {
|
|||
public static void bootstrapCardsAndRatings() {
|
||||
// preload cards and ratings
|
||||
log.info("Loading cards and rating...");
|
||||
List<Card> cards = CardScanner.getAllCards(false, true, true);
|
||||
List<Card> cards = CardScanner.getAllCards(false);
|
||||
for (Card card : cards) {
|
||||
RateCard.rateCard(card, null);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -329,7 +329,7 @@ public class VerifyCardDataTest {
|
|||
checkWrongAbilitiesTextStart();
|
||||
|
||||
int cardIndex = 0;
|
||||
List<Card> allCards = CardScanner.getAllCards(true, true, false);
|
||||
List<Card> allCards = CardScanner.getAllCards();
|
||||
for (Card card : allCards) {
|
||||
cardIndex++;
|
||||
if (card instanceof CardWithHalves) {
|
||||
|
|
|
|||
|
|
@ -3,7 +3,10 @@ package mage.cards.repository;
|
|||
import mage.cards.*;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author North
|
||||
|
|
@ -80,28 +83,17 @@ public final class CardScanner {
|
|||
}
|
||||
|
||||
public static List<Card> getAllCards() {
|
||||
return getAllCards(true, true, true);
|
||||
return getAllCards(true);
|
||||
}
|
||||
|
||||
public static List<Card> getAllCards(boolean ignoreCustomSets, boolean uniqueByName, boolean uniqueBySet) {
|
||||
Set<String> uniqueCardNames = new HashSet<>();
|
||||
public static List<Card> getAllCards(boolean ignoreCustomSets) {
|
||||
Collection<ExpansionSet> sets = Sets.getInstance().values();
|
||||
List<Card> cards = new ArrayList<>();
|
||||
for (ExpansionSet set : sets) {
|
||||
if (ignoreCustomSets && set.getSetType().isCustomSet()) {
|
||||
continue;
|
||||
}
|
||||
if (uniqueBySet) {
|
||||
uniqueCardNames.clear();
|
||||
}
|
||||
for (ExpansionSet.SetCardInfo setInfo : set.getSetCardInfo()) {
|
||||
if (uniqueByName) {
|
||||
String cardName = setInfo.getName();
|
||||
if (uniqueCardNames.contains(cardName)) {
|
||||
continue;
|
||||
}
|
||||
uniqueCardNames.add(cardName);
|
||||
}
|
||||
cards.add(CardImpl.createCard(setInfo.getCardClass(), new CardSetInfo(setInfo.getName(), set.getCode(),
|
||||
setInfo.getCardNumber(), setInfo.getRarity(), setInfo.getGraphicInfo())));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue