forked from External/mage
game timer: Add chess-style buffer time option (#10598)
* UI Changes * Add new buffer time options * Main functionality * Final implementation Also added player UI for when they are using their buffer time (timer turns green)
This commit is contained in:
parent
b7543af939
commit
519b3988be
24 changed files with 273 additions and 16 deletions
41
Mage/src/main/java/mage/constants/MatchBufferTime.java
Normal file
41
Mage/src/main/java/mage/constants/MatchBufferTime.java
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
package mage.constants;
|
||||
|
||||
/**
|
||||
* The time a player receives whenever the timer starts. This ticks down before their normal time,
|
||||
* and refreshes to full every time the timer starts, creating a sort of buffer. Similar to how to
|
||||
* chess clocks work.
|
||||
*
|
||||
* Based off of MatchTimeLimit
|
||||
*
|
||||
* @author alexander-novo
|
||||
*/
|
||||
public enum MatchBufferTime {
|
||||
NONE(0, "None"),
|
||||
SEC__05(5, "5 Seconds"),
|
||||
SEC__10(10, "10 Seconds"),
|
||||
SEC__15(15, "15 Seconds"),
|
||||
SEC__20(20, "20 Seconds"),
|
||||
SEC__25(25, "25 Seconds"),
|
||||
SEC__30(30, "30 Seconds");
|
||||
|
||||
private final int matchSeconds;
|
||||
private final String name;
|
||||
|
||||
MatchBufferTime(int matchSeconds, String name) {
|
||||
this.matchSeconds = matchSeconds;
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public int getBufferTime() {
|
||||
return matchSeconds;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return name;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue