* @return the whole path rotated and translated so that the same end is connected at
* the a different point the pivot tile. There is only one other valid point that it can connect to.
*/
@Override
public TantrixPath mutate(TilePlacement pivotTile, TantrixPath subPath) {
TilePlacementList tiles = new TilePlacementList();
TilePlacementList subPathTiles = subPath.getTilePlacements();
TilePlacement firstTile = subPathTiles.get(0);
Location firstTileLocation = firstTile.getLocation();
int numRotations = findRotationsToSwapLocation(firstTileLocation, pivotTile);
int directionToPivot = findOutgoingDirection(firstTile, pivotTile.getLocation());
Location newLocation = HexUtil.getNeighborLocation(pivotTile.getLocation(), numRotations);
Location origLocation = pivotTile.getLocation();
numRotations = numRotations + 3 - directionToPivot;
Rotation tileRotation = firstTile.getRotation().rotateBy(numRotations);
TilePlacement previousTilePlacement = new TilePlacement(firstTile.getTile(), newLocation, tileRotation);
tiles.add(previousTilePlacement);
// this part almost the same as reverser
for (int i=1; i<subPathTiles.size(); i++) {
TilePlacement currentTile = subPathTiles.get(i);
newLocation = findOtherOutgoingLocation(previousTilePlacement, origLocation);
Rotation tileRotation1 = currentTile.getRotation().rotateBy(numRotations);
TilePlacement currentTilePlacement = new TilePlacement(currentTile.getTile(), newLocation, tileRotation1);