mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 12:31:59 -08:00
Basic groundwork for extra decks (contraptions, attractions) (#10378)
* extra deck cards not counted in deck size * extra deck handling in deckbuilder * move responsibility for extraDeckCard boolean to CardImpl * remove redundant field copy
This commit is contained in:
parent
978ebfc873
commit
9ba0da00ff
29 changed files with 97 additions and 47 deletions
|
|
@ -1920,7 +1920,15 @@ public class DragCardGrid extends JPanel implements DragCardSource, DragCardTarg
|
|||
}
|
||||
|
||||
private void updateCounts() {
|
||||
deckNameAndCountLabel.setText(role.getName() + " - " + allCards.size());
|
||||
int extraDeckCount = allCards.stream()
|
||||
.filter(c -> c.isExtraDeckCard())
|
||||
.collect(Collectors.toSet())
|
||||
.size();
|
||||
int maindeckCount = allCards.size() - extraDeckCount;
|
||||
deckNameAndCountLabel.setText(role.getName() + " - " + maindeckCount + (
|
||||
extraDeckCount > 0 ? " (" + extraDeckCount + ")"
|
||||
: ""
|
||||
));
|
||||
creatureCountLabel.setText(String.valueOf(creatureCounter.get()));
|
||||
landCountLabel.setText(String.valueOf(landCounter.get()));
|
||||
for (CardType cardType : selectByTypeButtons.keySet()) {
|
||||
|
|
|
|||
|
|
@ -473,7 +473,7 @@ public class AddLandDialog extends MageDialog {
|
|||
|
||||
private void autoAddLands() {
|
||||
int deckSize = ((Number) spnDeckSize.getValue()).intValue();
|
||||
int[] lands = DeckBuildUtils.landCountSuggestion(deckSize, deck.getCards());
|
||||
int[] lands = DeckBuildUtils.landCountSuggestion(deckSize, deck.getMaindeckCards());
|
||||
spnPlains.setValue(lands[0]);
|
||||
spnIsland.setValue(lands[1]);
|
||||
spnSwamp.setValue(lands[2]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue