* @return a valid primary pth placement.
*/
private TilePlacement findPrimaryPathPlacementForTile(TantrixBoard board, HexTile tile, boolean isLast) {
TilePlacement lastPlaced = board.getLastTile();
PrimaryPathFitter fitter = new PrimaryPathFitter(board.getTantrix(), board.getPrimaryColor());
Map<Integer, Location> outgoing = lastPlaced.getOutgoingPathLocations(primaryColor);
Location nextLocation = null;
for (int i : outgoing.keySet()) {
if (board.getTilePlacement(outgoing.get(i)) == null) {
nextLocation = outgoing.get(i);
}
}
assert nextLocation != null;
TilePlacementList validFits =
fitter.getFittingPlacements(tile, nextLocation);
if (validFits.isEmpty()) {
return null;
}