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:
Alexander Novotny 2023-07-28 22:05:21 -04:00 committed by GitHub
parent b7543af939
commit 519b3988be
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
24 changed files with 273 additions and 16 deletions

View file

@ -143,7 +143,8 @@ public abstract class GameImpl implements Game {
private boolean scopeRelevant = false; // replacement effects: used to indicate that currently applied replacement effects have to check for scope relevance (614.12 13/01/18)
private boolean saveGame = false; // replay code, not done
private int priorityTime; // match time limit
private int priorityTime; // Match time limit (per player). Set at the start of the match and only goes down.
private int bufferTime; // Buffer time before priority time starts going down. Buffer time is refreshed every time the timer starts.
private final int startingLife;
private final int startingHandSize;
private final int minimumDeckSize;
@ -253,6 +254,7 @@ public abstract class GameImpl implements Game {
this.scopeRelevant = game.scopeRelevant;
this.saveGame = game.saveGame;
this.priorityTime = game.priorityTime;
this.bufferTime = game.bufferTime;
this.startingLife = game.startingLife;
this.startingHandSize = game.startingHandSize;
this.minimumDeckSize = game.minimumDeckSize;
@ -3645,6 +3647,16 @@ public abstract class GameImpl implements Game {
this.priorityTime = priorityTime;
}
@Override
public int getBufferTime() {
return bufferTime;
}
@Override
public void setBufferTime(int bufferTime) {
this.bufferTime = bufferTime;
}
@Override
public UUID getStartingPlayerId() {
return startingPlayerId;