slowpath option

This commit is contained in:
Leijurv 2018-08-06 07:01:25 -07:00
parent 5964ac60b4
commit 95086bdcb4
No known key found for this signature in database
GPG Key ID: 44A3EA646EADAC6A
2 changed files with 7 additions and 1 deletions

View File

@ -74,6 +74,11 @@ public class PathingBehavior extends Behavior {
event.cancel(); event.cancel();
return; return;
} }
if (msg.toLowerCase().equals("slowpath")) {
AStarPathFinder.slowPath ^= true;
event.cancel();
return;
}
} }

View File

@ -23,6 +23,8 @@ import java.util.Random;
*/ */
public class AStarPathFinder extends AbstractNodeCostSearch { public class AStarPathFinder extends AbstractNodeCostSearch {
public static boolean slowPath = false;
public AStarPathFinder(BlockPos start, Goal goal) { public AStarPathFinder(BlockPos start, Goal goal) {
super(start, goal); super(start, goal);
} }
@ -42,7 +44,6 @@ public class AStarPathFinder extends AbstractNodeCostSearch {
} }
currentlyRunning = this; currentlyRunning = this;
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
boolean slowPath = true;
long timeoutTime = startTime + (slowPath ? 40000 : 4000); long timeoutTime = startTime + (slowPath ? 40000 : 4000);
long lastPrintout = 0; long lastPrintout = 0;
int numNodes = 0; int numNodes = 0;