mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 04:38:00 +00:00
don't inflate 'decks that contain this card' count when the card appears in both the main deck and the sideboard
This commit is contained in:
@@ -33,6 +33,7 @@ import com.google.common.base.Function;
|
|||||||
|
|
||||||
import forge.Command;
|
import forge.Command;
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
|
import forge.deck.CardPool;
|
||||||
import forge.deck.Deck;
|
import forge.deck.Deck;
|
||||||
import forge.deck.DeckBase;
|
import forge.deck.DeckBase;
|
||||||
import forge.deck.DeckSection;
|
import forge.deck.DeckSection;
|
||||||
@@ -214,14 +215,19 @@ public final class CEditorQuestCardShop extends ACEditorBase<InventoryItem, Deck
|
|||||||
private ItemPool<InventoryItem> countDecksForEachCard() {
|
private ItemPool<InventoryItem> countDecksForEachCard() {
|
||||||
final ItemPool<InventoryItem> result = new ItemPool<InventoryItem>(InventoryItem.class);
|
final ItemPool<InventoryItem> result = new ItemPool<InventoryItem>(InventoryItem.class);
|
||||||
for (final Deck deck : this.questData.getMyDecks()) {
|
for (final Deck deck : this.questData.getMyDecks()) {
|
||||||
for (final Entry<CardPrinted, Integer> e : deck.getMain()) {
|
CardPool main = deck.getMain();
|
||||||
|
for (final Entry<CardPrinted, Integer> e : main) {
|
||||||
result.add(e.getKey());
|
result.add(e.getKey());
|
||||||
}
|
}
|
||||||
if ( deck.has(DeckSection.Sideboard))
|
if (deck.has(DeckSection.Sideboard)) {
|
||||||
for (final Entry<CardPrinted, Integer> e : deck.get(DeckSection.Sideboard)) {
|
for (final Entry<CardPrinted, Integer> e : deck.get(DeckSection.Sideboard)) {
|
||||||
|
// only add card if we haven't already encountered it in main
|
||||||
|
if (!main.contains(e.getKey())) {
|
||||||
result.add(e.getKey());
|
result.add(e.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user