if (neighborCoords[n].x == pos.x || neighborCoords[n].y == pos.y) {
distance = straightDistance;
} else {
distance = diagonalDistance;
}
retValue[n] = new FieldDistanceInfo(getField(neighborCoords[n]), distance);
} else {
Coordinate adjustedCoord = adjustToMapSize(neighborCoords[n]);
if (adjustedCoord == null) {
retValue[n] = null;
} else {
int distance = 0;
if (adjustedCoord.y == pos.y) {
distance = straightDistance;
} else {
distance = diagonalDistance;
}
retValue[n] = new FieldDistanceInfo(getField(adjustedCoord), distance);
}
}
}
return retValue;