コード例 #1
0
  public static GameFacade newGame(Player firstPlayer, Player secondPlayer) {
    MainGame game = new MainGame(firstPlayer, secondPlayer);
    game.setPlayableTurnSubGames();

    return new GameFacade(GamePersistencyTracker.trackNewGame(game));
  }
コード例 #2
0
  public static GameFacade loadGame(File file) throws GamesXmlRepositoryException {
    GamePersistencyTracker persistencyTracker = GamePersistencyTracker.loadAndTrackGame(file);

    return new GameFacade(persistencyTracker);
  }
コード例 #3
0
 private GameFacade(GamePersistencyTracker persistencyTracker) {
   this.persistencyTracker = persistencyTracker;
   this.engine = new RulesValidatorGameEngine(new BasicGameEngine(persistencyTracker.getGame()));
   this.hasUnsavedMoves = false;
   this.isSaveAllowed = persistencyTracker.isLoadedGame();
 }