mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 21:42:07 -08:00
[STX] added booster collation
This commit is contained in:
parent
45a50d9707
commit
d6c3ef33f0
3 changed files with 253 additions and 11 deletions
|
|
@ -284,13 +284,7 @@ public abstract class ExpansionSet implements Serializable {
|
|||
|
||||
private List<Card> createBoosterUsingCollator() {
|
||||
if (inBoosterMap.isEmpty()) {
|
||||
CardCriteria criteria = new CardCriteria();
|
||||
criteria.setCodes(code);
|
||||
CardRepository
|
||||
.instance
|
||||
.findCards(criteria)
|
||||
.stream()
|
||||
.forEach(cardInfo -> inBoosterMap.put(cardInfo.getCardNumber(), cardInfo));
|
||||
generateBoosterMap();
|
||||
}
|
||||
return boosterCollator
|
||||
.makeBooster()
|
||||
|
|
@ -300,6 +294,14 @@ public abstract class ExpansionSet implements Serializable {
|
|||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
protected void generateBoosterMap() {
|
||||
CardRepository
|
||||
.instance
|
||||
.findCards(new CardCriteria().setCodes(code))
|
||||
.stream()
|
||||
.forEach(cardInfo -> inBoosterMap.put(cardInfo.getCardNumber(), cardInfo));
|
||||
}
|
||||
|
||||
protected boolean boosterIsValid(List<Card> booster) {
|
||||
if (validateBoosterColors) {
|
||||
if (!validateColors(booster)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue