예제 #1
0
 public static LinkedList<Vector2f> find(
     Field2D maps, Vector2f start, Vector2f goal, boolean flag) {
   if (astar == null) {
     astar = new AStarFinder();
   }
   return astar.calc(maps, start, goal, flag);
 }
예제 #2
0
 public static LinkedList<Vector2f> find(
     int[][] maps, Vector2f start, Vector2f goal, boolean flag) {
   if (astar == null) {
     astar = new AStarFinder();
   }
   if (fieldMap == null) {
     fieldMap = new Field2D(maps);
   } else {
     fieldMap.setMap(maps);
   }
   return astar.calc(fieldMap, start, goal, flag);
 }
예제 #3
0
 public static LinkedList<Vector2f> find(
     Field2D maps, int x1, int y1, int x2, int y2, boolean flag) {
   if (astar == null) {
     astar = new AStarFinder();
   }
   if (start == null) {
     start = new Vector2f(x1, y1);
   } else {
     start.set(x1, y1);
   }
   if (over == null) {
     over = new Vector2f(x2, y2);
   } else {
     over.set(x2, y2);
   }
   return astar.calc(maps, start, over, flag);
 }