public static <TSquare extends ReadOnlySquare> ImmutableList<SquaresSequence<TSquare>> generate( Game<TSquare> game) { ThrowHelper.throwOnNull(game, "game"); ArrayList<SquaresSequence<TSquare>> promisingSequences = Lists.newArrayListWithCapacity(GameBoardPosition.DIMENSION + 2); for (int i = 0; i < GameBoardPosition.DIMENSION; ++i) { addIfPromising(promisingSequences, new RowSequence<TSquare>(game, i)); addIfPromising(promisingSequences, new ColumnSequence<TSquare>(game, i)); } addIfPromising(promisingSequences, new MainDiagonalSequence<TSquare>(game)); addIfPromising(promisingSequences, new SecondaryDiagonalSequence<TSquare>(game)); return ImmutableList.copyOf(promisingSequences); }
public static GameFacade loadGame(String fileName) throws GamesXmlRepositoryException { return loadGame(new File(ThrowHelper.throwOnNull(fileName, "fileName"))); }
public void save(String fileName) throws GamesXmlRepositoryException { save(new File(ThrowHelper.throwOnNull(fileName, "fileName"))); }
public PlayerAI createComputerAI(GameDifficulty difficulty) { ThrowHelper.throwOnNull(difficulty, "difficulty"); return PlayerAIFactory.create(getGame(), difficulty.movesAhead()); }