feat: implemented partial RoundTimer

This commit is contained in:
Yannik Bretschneider 2021-06-02 18:26:35 +02:00
parent 302fc5246d
commit 2380012d35
1 changed files with 30 additions and 0 deletions

View File

@ -0,0 +1,30 @@
package uulm.teamname.marvelous.server.lobby;
import uulm.teamname.marvelous.server.ParticipantType;
import uulm.teamname.marvelous.server.lobbymanager.Participant;
import java.util.Timer;
import java.util.TimerTask;
public class RoundTimer {
private final Timer timer;
private final Lobby parent;
private final int time;
public RoundTimer(int maxRoundTime, Lobby parent) {
this.timer = new Timer();
time = maxRoundTime;
this.parent = parent;
}
public void startRoundTimer(Participant p) {
if (p.type == ParticipantType.Spectator) throw new IllegalStateException("Spectators don't have TurnTime");
timer.cancel();
// timer.schedule(new TimerTask() {
// @Override
// public void run() {
// // TODO: skip current round
// }
// });
}
}