mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
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
|
|
@ -150,15 +150,18 @@ public class GameController implements GameCallback {
|
|||
if (playerId == null) {
|
||||
throw new MageException("RESUME_TIMER: playerId can't be null");
|
||||
}
|
||||
Player player = game.getState().getPlayer(playerId);
|
||||
if (player == null) {
|
||||
throw new MageException("RESUME_TIMER: player can't be null");
|
||||
}
|
||||
|
||||
timer = timers.get(playerId);
|
||||
if (timer == null) {
|
||||
Player player = game.getState().getPlayer(playerId);
|
||||
if (player != null) {
|
||||
timer = createPlayerTimer(event.getPlayerId(), player.getPriorityTimeLeft());
|
||||
} else {
|
||||
throw new MageException("RESUME_TIMER: player can't be null");
|
||||
}
|
||||
timer = createPlayerTimer(event.getPlayerId(), player.getPriorityTimeLeft());
|
||||
}
|
||||
|
||||
player.setBufferTimeLeft(game.getBufferTime());
|
||||
timer.setBufferCount(game.getBufferTime());
|
||||
timer.resume();
|
||||
break;
|
||||
case PAUSE_TIMER:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue