* @return all the opponent's shortest paths to specified players home bases.
*/
public PathList findAllOpponentShortestPaths(boolean player1) {
int numShortestPaths = Homes.NUM_HOMES * Homes.NUM_HOMES;
PathList opponentPaths = new PathList();
Set<BlockadeBoardPosition> hsPawns = new LinkedHashSet<BlockadeBoardPosition>();
for ( int row = 1; row <= board.getNumRows(); row++ ) {
for ( int col = 1; col <= board.getNumCols(); col++ ) {
BlockadeBoardPosition pos = board.getPosition( row, col );
if ( pos.isOccupied() && pos.getPiece().isOwnedByPlayer1() != player1 ) {
hsPawns.add(pos);
assert (hsPawns.size() <= Homes.NUM_HOMES) : "Error: too many opponent pieces: " + hsPawns ;
PathList paths = findShortestPaths(pos);
GameContext.log(2, "about to add " + paths.size() + " more paths to "
+ opponentPaths.size() + " maxAllowed=" + numShortestPaths);
for (Path p: paths) {
opponentPaths.add(p);
}
}