Account for rebranded cards

This commit is contained in:
tool4EvEr
2023-09-01 21:30:12 +02:00
parent 45a59fe77a
commit 54302fc89b
2 changed files with 3 additions and 2 deletions

View File

@@ -130,6 +130,7 @@ public abstract class DeckGeneratorBase {
int res = 0;
while (res < cnt) {
PaperCard cp = source.get(MyRandom.getRandom().nextInt(srcLen));
// TODO AltName conversion needed?
int newCount = cardCounts.get(cp.getName()) + 1;
//add card to deck if not already maxed out on card

View File

@@ -215,7 +215,7 @@ public abstract class ACEditorBase<TItem extends InventoryItem, TModel extends D
Iterable<Entry<String,Integer>> cardsByName = null;
if (deck != null) {
final CardPool allCards = deck.getAllCardsInASinglePool(deck.has(DeckSection.Commander));
cardsByName = Aggregates.groupSumBy(allCards, PaperCard.FN_GET_NAME);
cardsByName = Aggregates.groupSumBy(allCards, pc -> pc.getRules().getNormalizedName());
}
for (final Entry<TItem, Integer> itemEntry : itemsToAdd) {
@@ -237,7 +237,7 @@ public abstract class ACEditorBase<TItem extends InventoryItem, TModel extends D
Entry<String, Integer> cardAmountInfo = Iterables.find(cardsByName, new Predicate<Entry<String, Integer>>() {
@Override
public boolean apply(Entry<String, Integer> t) {
return t.getKey().equals(card.getName());
return t.getKey().equals(card.getRules().getNormalizedName());
}
}, null);
if (cardAmountInfo != null) {