* GUI: fixed that users can select empty timing option in new tourney dialog;

This commit is contained in:
Oleg Agafonov 2021-07-26 14:42:42 +04:00
parent d3f2b537fb
commit f334b81de6
3 changed files with 23 additions and 4 deletions

View file

@ -22,11 +22,11 @@ public class DraftOptions extends LimitedOptions implements Serializable {
REGULAR("x1.5", "Regular (x1.5)", 1.5,
Arrays.asList(113, 105, 98, 90, 83, 75, 68, 60, 35, 30, 25, 20, 15, 10, 8)
),
PROFI("x1.0", "Professional (x1.0)", 1.0,
PROFESSIONAL("x1.0", "Professional (x1.0)", 1.0,
Arrays.asList(75, 70, 65, 60, 55, 50, 45, 40, 30, 25, 20, 15, 12, 10, 7)
),
NONE("ERROR", "", 0,
Arrays.asList(0)
Arrays.asList(1)
);
private final String shortName;
@ -57,7 +57,12 @@ public class DraftOptions extends LimitedOptions implements Serializable {
if (cardNum > 15) {
cardNum = 15;
}
return times.get(cardNum - 1);
if (times.size() <= cardNum) {
return times.get(cardNum - 1);
} else {
return times.get(times.size() - 1);
}
}
@Override