mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
[KLD] Some more fixes.
This commit is contained in:
parent
bf73eb4042
commit
a1e70e21f4
5 changed files with 57 additions and 21 deletions
|
|
@ -31,8 +31,8 @@ import java.io.Serializable;
|
|||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
import java.util.EnumMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import mage.cards.repository.CardCriteria;
|
||||
import mage.cards.repository.CardInfo;
|
||||
import mage.cards.repository.CardRepository;
|
||||
|
|
@ -45,7 +45,6 @@ import mage.util.RandomUtil;
|
|||
*/
|
||||
public abstract class ExpansionSet implements Serializable {
|
||||
|
||||
|
||||
protected String name;
|
||||
protected String code;
|
||||
protected Date releaseDate;
|
||||
|
|
@ -330,10 +329,21 @@ public abstract class ExpansionSet implements Serializable {
|
|||
if (numBoosterDoubleFaced > -1) {
|
||||
criteria.doubleFaced(false);
|
||||
}
|
||||
if (maxCardNumberInBooster != Integer.MAX_VALUE) {
|
||||
criteria.maxCardNumber(maxCardNumberInBooster);
|
||||
}
|
||||
// if (maxCardNumberInBooster != Integer.MAX_VALUE) {
|
||||
// criteria.maxCardNumber(maxCardNumberInBooster);
|
||||
// }
|
||||
savedCardsInfos = CardRepository.instance.findCards(criteria);
|
||||
// Workaround after card number is numeric
|
||||
if (maxCardNumberInBooster != Integer.MAX_VALUE) {
|
||||
Iterator<CardInfo> iterator = savedCardsInfos.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
CardInfo next = iterator.next();
|
||||
if (Integer.valueOf(next.getCardNumber()) > maxCardNumberInBooster) {
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
savedCards.put(rarity, savedCardsInfos);
|
||||
}
|
||||
// Return a copy of the saved cards information, as not to let modify the original.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue