Using now ExpansionRepository or tournament booster selection in client.

This commit is contained in:
LevelX2 2013-07-07 18:22:13 +02:00
parent 0f3b760333
commit ec3565e5f7
2 changed files with 6 additions and 4 deletions

View file

@ -106,10 +106,10 @@
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="jLabel5" min="-2" max="-2" attributes="0"/>
<EmptySpace min="-2" max="-2" attributes="0"/>
<Component id="pnlPacks" pref="64" max="32767" attributes="0"/>
<Component id="pnlPacks" pref="66" max="32767" attributes="0"/>
<EmptySpace min="-2" pref="11" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
<Component id="spnNumPlayers" alignment="0" pref="27" max="32767" attributes="1"/>
<Component id="spnNumPlayers" alignment="0" pref="29" max="32767" attributes="1"/>
<Component id="pnlDraftOptions" max="32767" attributes="1"/>
<Component id="jLabel2" min="-2" max="-2" attributes="0"/>
</Group>

View file

@ -43,6 +43,8 @@ import javax.swing.JOptionPane;
import javax.swing.SpinnerNumberModel;
import mage.cards.ExpansionSet;
import mage.cards.Sets;
import mage.cards.repository.ExpansionInfo;
import mage.cards.repository.ExpansionRepository;
import mage.client.MageFrame;
import mage.client.table.TournamentPlayerPanel;
import mage.constants.MatchTimeLimit;
@ -360,7 +362,7 @@ public class NewTournamentDialog extends MageDialog {
}
tOptions.getLimitedOptions().setConstructionTime((Integer)this.spnConstructTime.getValue() * 60);
for (JComboBox pack: packs) {
tOptions.getLimitedOptions().getSetCodes().add(((ExpansionSet) pack.getSelectedItem()).getCode());
tOptions.getLimitedOptions().getSetCodes().add(((ExpansionInfo) pack.getSelectedItem()).getCode());
}
}
tOptions.getMatchOptions().setMatchTimeLimit((MatchTimeLimit) this.cbTimeLimit.getSelectedItem());
@ -431,7 +433,7 @@ public class NewTournamentDialog extends MageDialog {
}
while (packs.size() < numPacks) {
JComboBox pack = new JComboBox();
pack.setModel(new DefaultComboBoxModel(Sets.getInstance().getWithBoosterSortedByReleaseDate()));
pack.setModel(new DefaultComboBoxModel(ExpansionRepository.instance.getWithBoostersSortedByReleaseDate()));
pnlPacks.add(pack);
packs.add(pack);
pack.addActionListener(new java.awt.event.ActionListener() {