This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package game;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
@@ -14,10 +15,13 @@ 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;
|
||||
|
||||
public Game() {
|
||||
this.players = new HashMap<>();
|
||||
@@ -49,9 +53,10 @@ public class Game {
|
||||
return players;
|
||||
}
|
||||
|
||||
public void startGame(MultiDoku doku) {
|
||||
public void startGame(MultiDoku doku, Instant startTime) {
|
||||
this.doku = doku;
|
||||
this.gameState = GameState.GameGoing;
|
||||
this.startTime = startTime;
|
||||
}
|
||||
|
||||
public GameState getGameState() {
|
||||
@@ -66,4 +71,8 @@ public class Game {
|
||||
return leaderboard;
|
||||
}
|
||||
|
||||
public Instant getStartTime() {
|
||||
return startTime;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user