Make Add Land dialog no longer add a random mix of regular and snow-covered basic lands (#9353)

The Add Land dialog now only adds regular basic lands and never snow-covered ones, unless you specifically select a set that only contains snow basics (e.g. MH1) Sets that only contain snow basics are not selectable when adding lands to a Limited deck.
This commit is contained in:
sprangg 2022-08-11 03:11:01 +03:00 committed by GitHub
parent ebdb6b53a4
commit 7554a2b6b5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 32 additions and 13 deletions

View file

@ -246,7 +246,7 @@ public class CardCriteria {
where.ne("setCode", ignoreSetCode);
}
if (!ignoreSetCodes.isEmpty()) {
where.or(ignoreSetCodes.size());
where.and(ignoreSetCodes.size());
clausesCount++;
}

View file

@ -37,13 +37,11 @@ public enum CardRepository {
private Dao<CardInfo, Object> cardDao;
private Set<String> classNames;
// sets with exclusively snow basics
public static final Set<String> snowLandSetCodes = new HashSet<>(Arrays.asList(
"CSP",
"MH1",
"SLD",
"ME2",
"ICE",
"KHM"
"ME2"
));
CardRepository() {

View file

@ -68,7 +68,7 @@ public final class TournamentUtil {
} else {
criteria.ignoreSetsWithSnowLands();
}
criteria.rarities(Rarity.LAND).name(landName);
criteria.rarities(Rarity.LAND).nameExact(landName);
List<CardInfo> lands = CardRepository.instance.findCards(criteria);
List<Card> cards = new ArrayList<>();
if (!lands.isEmpty()) {