mirror of
https://github.com/correl/mage.git
synced 2025-03-07 20:53:18 -10:00
Changed set selection for tournament boosters to only show sets with boosters. Closes issue #91.
This commit is contained in:
parent
94fd2429d1
commit
5517474c90
3 changed files with 21 additions and 4 deletions
|
@ -362,7 +362,7 @@ public class NewTournamentDialog extends MageDialog {
|
|||
}
|
||||
while (packs.size() < numPacks) {
|
||||
JComboBox pack = new JComboBox();
|
||||
pack.setModel(new DefaultComboBoxModel(Sets.getInstance().getSortedByReleaseDate()));
|
||||
pack.setModel(new DefaultComboBoxModel(Sets.getInstance().getWithBoosterSortedByReleaseDate()));
|
||||
pnlPacks.add(pack);
|
||||
packs.add(pack);
|
||||
pack.addActionListener(new java.awt.event.ActionListener() {
|
||||
|
|
|
@ -169,4 +169,8 @@ public abstract class ExpansionSet implements Serializable {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean hasBoosters() {
|
||||
return hasBoosters;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,9 @@
|
|||
|
||||
package mage.cards;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.*;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.ColoredManaSymbol;
|
||||
import mage.cards.decks.DeckCardLists;
|
||||
|
@ -37,9 +40,6 @@ import mage.cards.repository.CardRepository;
|
|||
import mage.util.ClassScanner;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.PrintWriter;
|
||||
import java.util.*;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -182,4 +182,17 @@ public class Sets extends HashMap<String, ExpansionSet> {
|
|||
});
|
||||
return sets;
|
||||
}
|
||||
|
||||
public ExpansionSet[] getWithBoosterSortedByReleaseDate() {
|
||||
ExpansionSet[] allSets = getSortedByReleaseDate();
|
||||
ArrayList<ExpansionSet> boosterSets = new ArrayList<ExpansionSet>();
|
||||
for (ExpansionSet set: allSets) {
|
||||
if (set.hasBoosters) {
|
||||
boosterSets.add(set);
|
||||
}
|
||||
}
|
||||
return boosterSets.toArray(new ExpansionSet[0]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue