diff --git a/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java b/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java index 1375095d5d..c5a4aa1575 100644 --- a/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java +++ b/Mage.Client/src/main/java/mage/client/deck/generator/DeckGenerator.java @@ -11,6 +11,7 @@ import mage.client.util.sets.ConstructedFormats; import mage.constants.CardType; import mage.constants.ColoredManaSymbol; import mage.constants.Rarity; +import mage.constants.SuperType; import mage.util.RandomUtil; import mage.util.TournamentUtil; @@ -153,7 +154,7 @@ public final class DeckGenerator { final CardCriteria nonBasicLandCriteria = new CardCriteria(); nonBasicLandCriteria.setCodes(sets); nonBasicLandCriteria.types(CardType.LAND); - nonBasicLandCriteria.notSupertypes("Basic"); + nonBasicLandCriteria.notSupertypes(SuperType.BASIC); // Generate basic land cards Map> basicLands = generateBasicLands(setsToUse); diff --git a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java index 6f397e65c9..ef2d836f3b 100644 --- a/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java +++ b/Mage.Sets/src/mage/sets/StrixhavenSchoolOfMages.java @@ -458,7 +458,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet { cardInfos.addAll(CardRepository.instance.findCards(new CardCriteria() .setCodes(this.code) .rarities(rarity) - .subtypes("Lesson"))); + .subtypes(SubType.LESSON))); cardInfos.removeIf(cardInfo -> cardInfo.getCardNumberAsInt() > maxCardNumberInBooster); } return cardInfos; diff --git a/Mage/src/main/java/mage/cards/repository/CardCriteria.java b/Mage/src/main/java/mage/cards/repository/CardCriteria.java index 94d73d0da2..2bb87995a1 100644 --- a/Mage/src/main/java/mage/cards/repository/CardCriteria.java +++ b/Mage/src/main/java/mage/cards/repository/CardCriteria.java @@ -5,6 +5,8 @@ import com.j256.ormlite.stmt.SelectArg; import com.j256.ormlite.stmt.Where; import mage.constants.CardType; import mage.constants.Rarity; +import mage.constants.SubType; +import mage.constants.SuperType; import java.sql.SQLException; import java.util.ArrayList; @@ -23,9 +25,9 @@ public class CardCriteria { private final List ignoreSetCodes; // sets to ignore, use with little amount of sets (example: ignore sets with snow lands) private final List types; private final List notTypes; - private final List supertypes; - private final List notSupertypes; - private final List subtypes; + private final List supertypes; + private final List notSupertypes; + private final List subtypes; private final List rarities; private Boolean doubleFaced; private boolean black; @@ -152,17 +154,17 @@ public class CardCriteria { return this; } - public CardCriteria supertypes(String... supertypes) { + public CardCriteria supertypes(SuperType... supertypes) { this.supertypes.addAll(Arrays.asList(supertypes)); return this; } - public CardCriteria notSupertypes(String... supertypes) { + public CardCriteria notSupertypes(SuperType... supertypes) { this.notSupertypes.addAll(Arrays.asList(supertypes)); return this; } - public CardCriteria subtypes(String... subtypes) { + public CardCriteria subtypes(SubType... subtypes) { this.subtypes.addAll(Arrays.asList(subtypes)); return this; } @@ -251,17 +253,17 @@ public class CardCriteria { clausesCount++; } - for (String superType : supertypes) { - where.like("supertypes", new SelectArg('%' + superType + '%')); + for (SuperType superType : supertypes) { + where.like("supertypes", new SelectArg('%' + superType.name() + '%')); clausesCount++; } - for (String subType : notSupertypes) { - where.not().like("supertypes", new SelectArg('%' + subType + '%')); + for (SuperType superType : notSupertypes) { + where.not().like("supertypes", new SelectArg('%' + superType.name() + '%')); clausesCount++; } - for (String subType : subtypes) { - where.like("subtypes", new SelectArg('%' + subType + '%')); + for (SubType subType : subtypes) { + where.like("subtypes", new SelectArg('%' + subType.name() + '%')); clausesCount++; } @@ -389,15 +391,15 @@ public class CardCriteria { return notTypes; } - public List getSupertypes() { + public List getSupertypes() { return supertypes; } - public List getNotSupertypes() { + public List getNotSupertypes() { return notSupertypes; } - public List getSubtypes() { + public List getSubtypes() { return subtypes; }