feat: implemented partial RoundTimer
This commit is contained in:
parent
302fc5246d
commit
2380012d35
@ -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
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user