foul-magics/Mage/src/main/java/mage/constants/MatchBufferTime.java
Alexander Novotny 519b3988be
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)
2023-07-28 22:05:21 -04:00

41 lines
950 B
Java

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;
}
}