private boolean isTilePlacementWithOneAdjacentBridgeAllowed(Tile tile, Position p) {
boolean bridgeUsed = false;
for (Entry<Location, Tile> e : getBoard().getAdjacentTilesMap(p).entrySet()) {
Tile adjacent = e.getValue();
Location rel = e.getKey();
char tileSide = tile.getEdge(rel);
char adjacentSide = adjacent.getEdge(rel.rev());
if (tileSide != adjacentSide) {
if (bridgeUsed) return false;
if (tileSide != 'R') return false;
Location bridgeLoc = getBridgeLocationForAdjacent(rel);
if (!isBridgePlacementAllowed(adjacent, adjacent.getPosition(), bridgeLoc)) return false;
bridgeUsed = true;
}
}
return bridgeUsed; //ok if exactly one bridge is used