forked from External/mage
* Draft improves:
* added additional and improved timing options for pick timeouts (x1.0, x1.5, x2.0, see #8033); * added pick timing info in tables list (info column); * fixed that booster draft starts with wrong pick timeout (#8036);
This commit is contained in:
parent
214b688fdb
commit
400acae0c1
9 changed files with 71 additions and 37 deletions
|
|
@ -1,41 +1,69 @@
|
|||
|
||||
|
||||
package mage.game.draft;
|
||||
|
||||
import java.io.Serializable;
|
||||
import mage.game.tournament.LimitedOptions;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
* @author BetaSteward_at_googlemail.com, JayDi85
|
||||
*/
|
||||
public class DraftOptions extends LimitedOptions implements Serializable {
|
||||
|
||||
protected String draftType;
|
||||
protected TimingOption timing;
|
||||
|
||||
|
||||
public enum TimingOption {
|
||||
REGULAR (1),
|
||||
BEGINNER (2),
|
||||
NONE (0);
|
||||
|
||||
private int factor;
|
||||
// seconds per card's pick
|
||||
BEGINNER("x2.0", "Beginner (x2.0)", 2.0,
|
||||
Arrays.asList(150, 140, 130, 120, 110, 100, 90, 80, 45, 35, 30, 25, 20, 15, 10)
|
||||
),
|
||||
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", "Profi (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)
|
||||
);
|
||||
|
||||
TimingOption(int factor) {
|
||||
this.factor = factor;
|
||||
private final String shortName;
|
||||
private final String name;
|
||||
private final double customTimeoutFactor; // profi as x1.0, other modes increases by factor from x1.5 to x2.0
|
||||
private final List<Integer> times;
|
||||
|
||||
TimingOption(String shortName, String name, double customTimeoutFactor, List<Integer> times) {
|
||||
this.shortName = shortName;
|
||||
this.name = name;
|
||||
this.customTimeoutFactor = customTimeoutFactor;
|
||||
this.times = times;
|
||||
}
|
||||
|
||||
public int getFactor() {
|
||||
return this.factor;
|
||||
public String getShortName() {
|
||||
return shortName;
|
||||
}
|
||||
}
|
||||
|
||||
public String getDraftType() {
|
||||
return draftType;
|
||||
}
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setDraftType(String draftType) {
|
||||
this.draftType = draftType;
|
||||
public double getCustomTimeoutFactor() {
|
||||
return customTimeoutFactor;
|
||||
}
|
||||
|
||||
public int getPickTimeout(int cardNum) {
|
||||
if (cardNum > 15) {
|
||||
cardNum = 15;
|
||||
}
|
||||
return times.get(cardNum - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
|
||||
public TimingOption getTiming() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue