refactor: more class name changes
This commit is contained in:
parent
c4badaf4ef
commit
6b10287808
@ -9,21 +9,21 @@ import java.util.concurrent.*;
|
|||||||
import java.util.function.Consumer;
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link TimeoutTimer} class is called by the {@link Lobby} to limit the amount of time a player has per round.
|
* The {@link TurnTimeoutTimer} class is called by the {@link Lobby} to limit the amount of time a player has per round.
|
||||||
*/
|
*/
|
||||||
public class TimeoutTimer {
|
public class TurnTimeoutTimer {
|
||||||
private final ScheduledExecutorService timer;
|
private final ScheduledExecutorService timer;
|
||||||
private final Consumer<Participant> callback;
|
private final Consumer<Participant> callback;
|
||||||
private final int maxRoundTime;
|
private final int maxRoundTime;
|
||||||
|
|
||||||
private ScheduledFuture<Participant> current;
|
private ScheduledFuture<Participant> current;
|
||||||
|
|
||||||
public TimeoutTimer(int maxRoundTime, Consumer<Participant> callback) {
|
public TurnTimeoutTimer(int maxRoundTime, Consumer<Participant> callback) {
|
||||||
String lobbyThreadName = Thread.currentThread().getName();
|
String lobbyThreadName = Thread.currentThread().getName();
|
||||||
ThreadFactory threadFactory = new ThreadFactory() {
|
ThreadFactory threadFactory = new ThreadFactory() {
|
||||||
@Override
|
@Override
|
||||||
public Thread newThread(Runnable r) {
|
public Thread newThread(Runnable r) {
|
||||||
return new Thread(r, lobbyThreadName + "-timerThread");
|
return new Thread(r, lobbyThreadName + "-TurnTimerThread");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.timer = Executors.newSingleThreadScheduledExecutor(threadFactory);
|
this.timer = Executors.newSingleThreadScheduledExecutor(threadFactory);
|
||||||
|
@ -5,21 +5,19 @@ import uulm.teamname.marvelous.gamelibrary.events.Event;
|
|||||||
import uulm.teamname.marvelous.gamelibrary.events.EventBuilder;
|
import uulm.teamname.marvelous.gamelibrary.events.EventBuilder;
|
||||||
import uulm.teamname.marvelous.gamelibrary.gamelogic.GameInstance;
|
import uulm.teamname.marvelous.gamelibrary.gamelogic.GameInstance;
|
||||||
import uulm.teamname.marvelous.gamelibrary.requests.Request;
|
import uulm.teamname.marvelous.gamelibrary.requests.Request;
|
||||||
import uulm.teamname.marvelous.gamelibrary.requests.RequestType;
|
|
||||||
import uulm.teamname.marvelous.server.lobby.Lobby;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.atomic.AtomicBoolean;
|
import java.util.concurrent.atomic.AtomicBoolean;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The {@link GameStateSegment} handles all {@link GameInstance game} relevant {@link Request Requests}. Therefore it
|
* The {@link GameLogicSegment} handles all {@link GameInstance game} relevant {@link Request Requests}. Therefore it
|
||||||
* updates the game with the matching request.
|
* updates the game with the matching request.
|
||||||
*/
|
*/
|
||||||
public class GameStateSegment implements Segment {
|
public class GameLogicSegment implements Segment {
|
||||||
private GameInstance game;
|
private GameInstance game;
|
||||||
|
|
||||||
|
|
||||||
public GameStateSegment(GameInstance game) {
|
public GameLogicSegment(GameInstance game) {
|
||||||
this.game = game;
|
this.game = game;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user