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
|
|
@ -47,6 +47,7 @@ public class PlayerView implements Serializable {
|
|||
private final List<UUID> attachments = new ArrayList<>();
|
||||
private final int statesSavedSize;
|
||||
private final int priorityTimeLeft;
|
||||
private final int bufferTimeLeft;
|
||||
private final boolean passedTurn; // F4
|
||||
private final boolean passedUntilEndOfTurn; // F5
|
||||
private final boolean passedUntilNextMain; // F6
|
||||
|
|
@ -74,6 +75,7 @@ public class PlayerView implements Serializable {
|
|||
this.isActive = (player.getId().equals(state.getActivePlayerId()));
|
||||
this.hasPriority = player.getId().equals(state.getPriorityPlayerId());
|
||||
this.priorityTimeLeft = player.getPriorityTimeLeft();
|
||||
this.bufferTimeLeft = player.getBufferTimeLeft();
|
||||
this.timerActive = (this.hasPriority && player.isGameUnderControl())
|
||||
|| (player.getPlayersUnderYourControl().contains(state.getPriorityPlayerId()))
|
||||
|| player.getId().equals(game.getState().getChoosingPlayerId());
|
||||
|
|
@ -275,6 +277,10 @@ public class PlayerView implements Serializable {
|
|||
return priorityTimeLeft;
|
||||
}
|
||||
|
||||
public int getBufferTimeLeft() {
|
||||
return bufferTimeLeft;
|
||||
}
|
||||
|
||||
public boolean hasPriority() {
|
||||
return hasPriority;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue