use of org.xguzm.pathfinding.grid.GridCell in project BWAPI4J by OpenBW.
the class YATA method getPath.
public List<TilePosition> getPath(final TilePosition start, final TilePosition end) {
final GridCell startNode = this.nodes[start.getX()][start.getY()];
final GridCell endNode = this.nodes[end.getX()][end.getY()];
final List<GridCell> gridCellPath = this.finder.findPath(startNode, endNode, this.navigationGrid);
final List<TilePosition> tilePath = new ArrayList<>();
if (gridCellPath != null) {
for (final GridCell cell : gridCellPath) {
tilePath.add(new TilePosition(cell.x, cell.y));
}
}
return tilePath;
}
Aggregations