package game;

import java.util.HashMap;
import java.util.Map;

import sudoku.structure.MultiDoku;

public class Game {

	public static enum GameState {
		GameNotStarted, GameGoing, GameEnd
	}

	private final Map<Integer, Player> players;
	private GameState gameState;
	private MultiDoku doku;

	public Game() {
		this.players = new HashMap<>();
		this.gameState = GameState.GameNotStarted;
	}

	public Player getPlayerById(int id) {
		return players.get(id);
	}

	public void addPlayer(Player player) {
		players.put(player.getId(), player);
	}

	public void removePlayer(int id) {
		players.remove(id);
	}

	public Map<Integer, Player> getPlayers() {
		return players;
	}

	public void startGame(MultiDoku doku) {
		this.doku = doku;
		this.gameState = GameState.GameGoing;
	}

	public GameState getGameState() {
		return gameState;
	}

	public MultiDoku getDoku() {
		return doku;
	}

}
