feat: select game duration
All checks were successful
Linux arm64 / Build (push) Successful in 28s

This commit is contained in:
2025-02-01 12:27:50 +01:00
parent e98199e1ec
commit 02089c649b
9 changed files with 52 additions and 27 deletions

View File

@@ -15,13 +15,12 @@ public class Game {
GameNotStarted, GameGoing, GameEnd
}
public static final int GAME_DURATION = 10 * 60;
private final Map<Integer, Player> players;
private final List<Player> leaderboard;
private GameState gameState;
private MultiDoku doku;
private Instant startTime = null;
private long gameDuration;
public Game() {
this.players = new HashMap<>();
@@ -53,10 +52,15 @@ public class Game {
return players;
}
public void startGame(MultiDoku doku, Instant startTime) {
public void startGame(MultiDoku doku, Instant startTime, long gameDuration) {
this.doku = doku;
this.gameState = GameState.GameGoing;
this.startTime = startTime;
this.gameDuration = gameDuration;
}
public void stopGame() {
this.gameState = GameState.GameEnd;
}
public GameState getGameState() {
@@ -75,4 +79,8 @@ public class Game {
return startTime;
}
public long getGameDuration() {
return gameDuration;
}
}