Fix that MaxCardNumberInBooster filter is applied incorrectly and only part of the commons is used for booster generation in the Core Set 2019, Dragon's Maze and Fate Reforged sets

This commit is contained in:
Quercitron 2018-07-08 17:23:44 +03:00
parent a63fe12fce
commit 992470e1ea
3 changed files with 9 additions and 9 deletions

View file

@ -370,10 +370,10 @@ public final class CoreSet2019 extends ExpansionSet {
CardCriteria criteria = new CardCriteria();
criteria.rarities(Rarity.COMMON);
criteria.setCodes(this.code).notTypes(CardType.LAND);
if (maxCardNumberInBooster != Integer.MAX_VALUE) {
criteria.maxCardNumber(maxCardNumberInBooster);
}
savedCardsInfos = CardRepository.instance.findCards(criteria);
if (maxCardNumberInBooster != Integer.MAX_VALUE) {
savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster && rarity != Rarity.LAND);
}
savedCards.put(rarity, savedCardsInfos);
}
// Return a copy of the saved cards information, as not to let modify the original.

View file

@ -202,10 +202,10 @@ public final class DragonsMaze extends ExpansionSet {
CardCriteria criteria = new CardCriteria();
criteria.setCodes(this.code).notTypes(CardType.LAND);
criteria.rarities(rarity).doubleFaced(false);
if (maxCardNumberInBooster != Integer.MAX_VALUE) {
criteria.maxCardNumber(maxCardNumberInBooster);
}
savedCardsInfos = CardRepository.instance.findCards(criteria);
if (maxCardNumberInBooster != Integer.MAX_VALUE) {
savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster && rarity != Rarity.LAND);
}
savedCards.put(rarity, savedCardsInfos);
}
// Return a copy of the saved cards information, as not to modify the original.

View file

@ -236,10 +236,10 @@ public final class FateReforged extends ExpansionSet {
CardCriteria criteria = new CardCriteria();
criteria.rarities(Rarity.COMMON);
criteria.setCodes(this.code).notTypes(CardType.LAND);
if (maxCardNumberInBooster != Integer.MAX_VALUE) {
criteria.maxCardNumber(maxCardNumberInBooster);
}
savedCardsInfos = CardRepository.instance.findCards(criteria);
if (maxCardNumberInBooster != Integer.MAX_VALUE) {
savedCardsInfos.removeIf(next -> next.getCardNumberAsInt() > maxCardNumberInBooster && rarity != Rarity.LAND);
}
savedCards.put(rarity, savedCardsInfos);
}
// Return a copy of the saved cards information, as not to let modify the original.