changed collation to strings to allow non-int collector numbers

This commit is contained in:
Evan Kranzler 2021-02-12 20:14:43 -05:00
parent 1239a0299b
commit 073ec1cdb9
6 changed files with 34 additions and 34 deletions

View file

@ -122,7 +122,7 @@ public abstract class ExpansionSet implements Serializable {
protected int maxCardNumberInBooster; // used to omit cards with collector numbers beyond the regular cards in a set for boosters
protected final EnumMap<Rarity, List<CardInfo>> savedCards;
protected final Map<Integer, CardInfo> inBoosterMap = new HashMap<>();
protected final Map<String, CardInfo> inBoosterMap = new HashMap<>();
public ExpansionSet(String name, String code, Date releaseDate, SetType setType) {
this(name, code, releaseDate, setType, null);
@ -290,7 +290,7 @@ public abstract class ExpansionSet implements Serializable {
.instance
.findCards(criteria)
.stream()
.forEach(cardInfo -> inBoosterMap.put(cardInfo.getCardNumberAsInt(), cardInfo));
.forEach(cardInfo -> inBoosterMap.put(cardInfo.getCardNumber(), cardInfo));
}
return boosterCollator
.makeBooster()

View file

@ -9,5 +9,5 @@ public interface BoosterCollator {
public void shuffle();
public List<Integer> makeBooster();
public List<String> makeBooster();
}

View file

@ -20,8 +20,8 @@ public abstract class BoosterStructure {
this.slots = Arrays.asList(runs);
}
public List<Integer> makeRun() {
List<Integer> cards = new ArrayList<>();
public List<String> makeRun() {
List<String> cards = new ArrayList<>();
for (CardRun run : this.slots) {
cards.add(run.getNext());
}

View file

@ -3,9 +3,9 @@ package mage.collation;
/**
* @author TheElk801
*/
public abstract class CardRun extends Rotater<Integer> {
public abstract class CardRun extends Rotater<String> {
public CardRun(boolean keepOrder, Integer... names) {
super(keepOrder, names);
public CardRun(boolean keepOrder, String... numbers) {
super(keepOrder, numbers);
}
}