👌formatting in of comments

This commit is contained in:
ZacSharp 2020-10-15 21:48:17 +02:00
parent 0c7741120a
commit 3cdbc4cb83
No known key found for this signature in database
GPG Key ID: 9453647B005083A3
4 changed files with 5 additions and 5 deletions

View File

@ -61,7 +61,7 @@ public class GoalComposite implements Goal {
public double heuristic() {
double min = Double.MAX_VALUE;
for (Goal g : goals) {
//just take the highest value that is guaranteed to be inside the goal
// just take the highest value that is guaranteed to be inside the goal
min = Math.min(min, g.heuristic());
}
return min;

View File

@ -55,7 +55,7 @@ public class GoalNear implements Goal, IGoalRenderPos {
}
@Override
public double heuristic() {//TODO less hacky solution
public double heuristic() {// TODO less hacky solution
int range = (int) Math.ceil(Math.sqrt(rangeSq));
HashSet<Double> maybeAlwaysInside = new HashSet<>();
HashSet<Double> sometimesOutside = new HashSet<>();

View File

@ -68,7 +68,7 @@ public class GoalRunAway implements Goal {
}
@Override
public double heuristic(int x, int y, int z) {//mostly copied from GoalBlock
public double heuristic(int x, int y, int z) {// mostly copied from GoalBlock
double min = Double.MAX_VALUE;
for (BlockPos p : from) {
double h = GoalXZ.calculate(p.getX() - x, p.getZ() - z);
@ -84,7 +84,7 @@ public class GoalRunAway implements Goal {
}
@Override
public double heuristic() {//TODO less hacky solution
public double heuristic() {// TODO less hacky solution
int distance = (int) Math.ceil(Math.sqrt(distanceSq));
int minX = from[0].getX() - distance;
int minY = from[0].getY() - distance;

View File

@ -391,7 +391,7 @@ public final class PathingBehavior extends Behavior implements IPathingBehavior,
}
double current = goal.heuristic(currentPos.x, currentPos.y, currentPos.z);
double start = goal.heuristic(startPosition.x, startPosition.y, startPosition.z);
if (current == start) {//can't check above because current and start can be equal even if currentPos and startPosition are not
if (current == start) {// can't check above because current and start can be equal even if currentPos and startPosition are not
return Optional.empty();
}
double eta = Math.abs(current - goal.heuristic()) * ticksElapsedSoFar / Math.abs(start - current);