public static GameFacade newGame(Player firstPlayer, Player secondPlayer) { MainGame game = new MainGame(firstPlayer, secondPlayer); game.setPlayableTurnSubGames(); return new GameFacade(GamePersistencyTracker.trackNewGame(game)); }
public static GameFacade loadGame(File file) throws GamesXmlRepositoryException { GamePersistencyTracker persistencyTracker = GamePersistencyTracker.loadAndTrackGame(file); return new GameFacade(persistencyTracker); }
private GameFacade(GamePersistencyTracker persistencyTracker) { this.persistencyTracker = persistencyTracker; this.engine = new RulesValidatorGameEngine(new BasicGameEngine(persistencyTracker.getGame())); this.hasUnsavedMoves = false; this.isSaveAllowed = persistencyTracker.isLoadedGame(); }