Setting "Limited" deck type as default.

This commit is contained in:
magenoxx 2010-12-05 09:02:26 +00:00
parent 50df25489e
commit 881f162056
2 changed files with 14 additions and 1 deletions

View file

@ -357,7 +357,7 @@ public class DeckGenerator {
maxSingleCount = Math.max(maxSingleCount, typeCount); maxSingleCount = Math.max(maxSingleCount, typeCount);
} }
} }
return 2 * converted + +3 * (10 - SINGLE_PENALTY[maxSingleCount]/*-DOUBLE_PENALTY[doubleCount]*/); return 2 * converted + 3 * (10 - SINGLE_PENALTY[maxSingleCount]/*-DOUBLE_PENALTY[doubleCount]*/);
} }
public int getScore() { public int getScore() {

View file

@ -71,6 +71,8 @@ public class NewTableDialog extends MageDialog {
private Session session; private Session session;
private List<TablePlayerPanel> players = new ArrayList<TablePlayerPanel>(); private List<TablePlayerPanel> players = new ArrayList<TablePlayerPanel>();
private static final String LIMITED = "Limited";
/** Creates new form NewTableDialog */ /** Creates new form NewTableDialog */
public NewTableDialog() { public NewTableDialog() {
initComponents(); initComponents();
@ -376,6 +378,7 @@ public class NewTableDialog extends MageDialog {
this.player1Panel.setPlayerName(session.getUserName()); this.player1Panel.setPlayerName(session.getUserName());
cbGameType.setModel(new DefaultComboBoxModel(session.getGameTypes().toArray())); cbGameType.setModel(new DefaultComboBoxModel(session.getGameTypes().toArray()));
cbDeckType.setModel(new DefaultComboBoxModel(session.getDeckTypes())); cbDeckType.setModel(new DefaultComboBoxModel(session.getDeckTypes()));
selectLimitedByDefault();
cbRange.setModel(new DefaultComboBoxModel(RangeOfInfluence.values())); cbRange.setModel(new DefaultComboBoxModel(RangeOfInfluence.values()));
cbAttackOption.setModel(new DefaultComboBoxModel(MultiplayerAttackOption.values())); cbAttackOption.setModel(new DefaultComboBoxModel(MultiplayerAttackOption.values()));
this.roomId = roomId; this.roomId = roomId;
@ -392,6 +395,16 @@ public class NewTableDialog extends MageDialog {
public UUID getPlayerId() { public UUID getPlayerId() {
return playerId; return playerId;
} }
private void selectLimitedByDefault() {
for (int i = 0; i < cbDeckType.getItemCount(); i++) {
String name = (String)cbDeckType.getItemAt(i);
if (name.equals(LIMITED)) {
cbDeckType.setSelectedIndex(i);
break;
}
}
}
// Variables declaration - do not modify//GEN-BEGIN:variables // Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton btnCancel; private javax.swing.JButton btnCancel;