refactor: more class name changes

This commit is contained in:
Yannik Bretschneider 2021-06-07 16:44:29 +02:00
parent c4badaf4ef
commit 6b10287808
2 changed files with 7 additions and 9 deletions

View File

@ -9,21 +9,21 @@ import java.util.concurrent.*;
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 Consumer<Participant> callback;
private final int maxRoundTime;
private ScheduledFuture<Participant> current;
public TimeoutTimer(int maxRoundTime, Consumer<Participant> callback) {
public TurnTimeoutTimer(int maxRoundTime, Consumer<Participant> callback) {
String lobbyThreadName = Thread.currentThread().getName();
ThreadFactory threadFactory = new ThreadFactory() {
@Override
public Thread newThread(Runnable r) {
return new Thread(r, lobbyThreadName + "-timerThread");
return new Thread(r, lobbyThreadName + "-TurnTimerThread");
}
};
this.timer = Executors.newSingleThreadScheduledExecutor(threadFactory);

View File

@ -5,21 +5,19 @@ import uulm.teamname.marvelous.gamelibrary.events.Event;
import uulm.teamname.marvelous.gamelibrary.events.EventBuilder;
import uulm.teamname.marvelous.gamelibrary.gamelogic.GameInstance;
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.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.
*/
public class GameStateSegment implements Segment {
public class GameLogicSegment implements Segment {
private GameInstance game;
public GameStateSegment(GameInstance game) {
public GameLogicSegment(GameInstance game) {
this.game = game;
}