This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user