formatting and comments
This commit is contained in:
parent
ff068d374f
commit
5926369a56
@ -56,7 +56,7 @@ public class GoalNear implements Goal, IGoalRenderPos {
|
|||||||
@Override
|
@Override
|
||||||
public double heuristic() {// TODO less hacky solution
|
public double heuristic() {// TODO less hacky solution
|
||||||
int range = (int) Math.ceil(Math.sqrt(rangeSq));
|
int range = (int) Math.ceil(Math.sqrt(rangeSq));
|
||||||
DoubleOpenHashSet maybeAlwaysInside = new DoubleOpenHashSet();
|
DoubleOpenHashSet maybeAlwaysInside = new DoubleOpenHashSet(); // see pull request #1978
|
||||||
double minOutside = Double.POSITIVE_INFINITY;
|
double minOutside = Double.POSITIVE_INFINITY;
|
||||||
for (int dx = -range; dx <= range; dx++) {
|
for (int dx = -range; dx <= range; dx++) {
|
||||||
for (int dy = -range; dy <= range; dy++) {
|
for (int dy = -range; dy <= range; dy++) {
|
||||||
@ -72,7 +72,7 @@ public class GoalNear implements Goal, IGoalRenderPos {
|
|||||||
}
|
}
|
||||||
double maxInside = Double.NEGATIVE_INFINITY;
|
double maxInside = Double.NEGATIVE_INFINITY;
|
||||||
DoubleIterator it = maybeAlwaysInside.iterator();
|
DoubleIterator it = maybeAlwaysInside.iterator();
|
||||||
while(it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
double inside = it.nextDouble();
|
double inside = it.nextDouble();
|
||||||
if (inside < minOutside) {
|
if (inside < minOutside) {
|
||||||
maxInside = Math.max(maxInside, inside);
|
maxInside = Math.max(maxInside, inside);
|
||||||
|
@ -99,7 +99,7 @@ public class GoalRunAway implements Goal {
|
|||||||
maxY = Math.max(minY, p.getY() + distance);
|
maxY = Math.max(minY, p.getY() + distance);
|
||||||
maxZ = Math.max(minZ, p.getZ() + distance);
|
maxZ = Math.max(minZ, p.getZ() + distance);
|
||||||
}
|
}
|
||||||
DoubleOpenHashSet maybeAlwaysInside = new DoubleOpenHashSet();
|
DoubleOpenHashSet maybeAlwaysInside = new DoubleOpenHashSet(); // see pull request #1978
|
||||||
double minOutside = Double.POSITIVE_INFINITY;
|
double minOutside = Double.POSITIVE_INFINITY;
|
||||||
for (int x = minX; x <= maxX; x++) {
|
for (int x = minX; x <= maxX; x++) {
|
||||||
for (int y = minY; y <= maxY; y++) {
|
for (int y = minY; y <= maxY; y++) {
|
||||||
@ -115,7 +115,7 @@ public class GoalRunAway implements Goal {
|
|||||||
}
|
}
|
||||||
double maxInside = Double.NEGATIVE_INFINITY;
|
double maxInside = Double.NEGATIVE_INFINITY;
|
||||||
DoubleIterator it = maybeAlwaysInside.iterator();
|
DoubleIterator it = maybeAlwaysInside.iterator();
|
||||||
while(it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
double inside = it.nextDouble();
|
double inside = it.nextDouble();
|
||||||
if (inside < minOutside) {
|
if (inside < minOutside) {
|
||||||
maxInside = Math.max(maxInside, inside);
|
maxInside = Math.max(maxInside, inside);
|
||||||
|
Loading…
Reference in New Issue
Block a user