mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
Account for rebranded cards
This commit is contained in:
@@ -130,6 +130,7 @@ public abstract class DeckGeneratorBase {
|
|||||||
int res = 0;
|
int res = 0;
|
||||||
while (res < cnt) {
|
while (res < cnt) {
|
||||||
PaperCard cp = source.get(MyRandom.getRandom().nextInt(srcLen));
|
PaperCard cp = source.get(MyRandom.getRandom().nextInt(srcLen));
|
||||||
|
// TODO AltName conversion needed?
|
||||||
int newCount = cardCounts.get(cp.getName()) + 1;
|
int newCount = cardCounts.get(cp.getName()) + 1;
|
||||||
|
|
||||||
//add card to deck if not already maxed out on card
|
//add card to deck if not already maxed out on card
|
||||||
|
|||||||
@@ -215,7 +215,7 @@ public abstract class ACEditorBase<TItem extends InventoryItem, TModel extends D
|
|||||||
Iterable<Entry<String,Integer>> cardsByName = null;
|
Iterable<Entry<String,Integer>> cardsByName = null;
|
||||||
if (deck != null) {
|
if (deck != null) {
|
||||||
final CardPool allCards = deck.getAllCardsInASinglePool(deck.has(DeckSection.Commander));
|
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) {
|
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>>() {
|
Entry<String, Integer> cardAmountInfo = Iterables.find(cardsByName, new Predicate<Entry<String, Integer>>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Entry<String, Integer> t) {
|
public boolean apply(Entry<String, Integer> t) {
|
||||||
return t.getKey().equals(card.getName());
|
return t.getKey().equals(card.getRules().getNormalizedName());
|
||||||
}
|
}
|
||||||
}, null);
|
}, null);
|
||||||
if (cardAmountInfo != null) {
|
if (cardAmountInfo != null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user