Add possibility to play less rounds of swiss than xmage suggests (#7729)

* Make it possible to adjust the number of rounds in a swiss tournament to be less than the number of rounds suggested by xmage.

Co-authored-by: sprangg <a@b.c>
Co-authored-by: Oleg Agafonov <jaydi85@gmail.com>
This commit is contained in:
sprangg 2021-04-14 08:54:29 +03:00 committed by GitHub
parent 9128b5021c
commit 81f12c3f45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -913,7 +913,7 @@ public class NewTournamentDialog extends MageDialog {
// set the number of minimum swiss rounds related to the number of players
int minRounds = (int) Math.ceil(Math.log(numPlayers + 1) / Math.log(2));
int newValue = Math.max((Integer) spnNumRounds.getValue(), minRounds);
this.spnNumRounds.setModel(new SpinnerNumberModel(newValue, minRounds, 10, 1));
this.spnNumRounds.setModel(new SpinnerNumberModel(newValue, 2, 10, 1));
this.pack();
this.revalidate();
this.repaint();