Exemplo n.º 1
0
 public List<Tile> findPath() {
   MazeTileNode lastNode = run();
   if (isTarget(lastNode)) {
     // Reconstruct path
     List<MazeTileNode> nodePath = reconstructPath(lastNode);
     // Create list of tiles
     List<Tile> path = new LinkedList<Tile>();
     for (MazeTileNode node : nodePath) {
       path.add(node.getTile());
     }
     return path;
   } else {
     // No path found
     return null;
   }
 }
Exemplo n.º 2
0
 @Override
 public boolean isValidNode(MazeTileNode node) {
   return tileValidator.apply(node.getTile());
 }