private void cbTournamentTypeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cbTournamentTypeActionPerformed
setTournamentOptions((Integer) this.spnNumPlayers.getValue());
}//GEN-LAST:event_cbTournamentTypeActionPerformed
private void btnOkActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnOkActionPerformed
TournamentTypeView tournamentType = (TournamentTypeView) cbTournamentType.getSelectedItem();
TournamentOptions tOptions = new TournamentOptions(this.txtName.getText());
tOptions.setTournamentType(tournamentType.getName());
tOptions.setPassword(txtPassword.getText());
tOptions.getPlayerTypes().add("Human");
tOptions.setWatchingAllowed(cbAllowSpectators.isSelected());
for (TournamentPlayerPanel player: players) {
tOptions.getPlayerTypes().add((String) player.getPlayerType().getSelectedItem());
}
if (!tournamentType.isElimination()) {
tOptions.setNumberRounds((Integer)spnNumRounds.getValue());
}
if (tournamentType.isDraft()) {
DraftOptions options = new DraftOptions();
options.setDraftType("");
options.setTiming((TimingOption) this.cbDraftTiming.getSelectedItem());
tOptions.setLimitedOptions(options);
}
if (tOptions.getLimitedOptions() == null) {
tOptions.setLimitedOptions(new LimitedOptions());
}
if (tournamentType.isLimited()) {
tOptions.getLimitedOptions().setConstructionTime((Integer)this.spnConstructTime.getValue() * 60);
if (tournamentType.isCubeBooster()) {
tOptions.getLimitedOptions().setDraftCubeName(this.cbDraftCube.getSelectedItem().toString());
} else {
for (JComboBox pack: packs) {
tOptions.getLimitedOptions().getSetCodes().add(((ExpansionInfo) pack.getSelectedItem()).getCode());
}