/**
* find all the paths from each player's pawn to each opponent base.
*/
public PlayerPathLengths findPlayerPathLengths() {
PlayerPathLengths playerPaths = new PlayerPathLengths();
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() ) {
GamePiece piece = pos.getPiece();
// should reuse cached path if still valid.
PathList paths = board.findShortestPaths(pos);
playerPaths.getPathLengthsForPlayer(piece.isOwnedByPlayer1()).updatePathLengths(paths);
}
}
}
return playerPaths;
}