use grid_pathfinding::{waypoints_to_path, PathingGrid};
use grid_util::grid::ValueGrid;
use grid_util::point::Point;
fn main() {
let mut pathing_grid: PathingGrid = PathingGrid::new(5, 5, false);
pathing_grid.set(1, 1, true);
pathing_grid.generate_components();
println!("{}", pathing_grid);
let start = Point::new(0, 0);
let end = Point::new(4, 4);
if let Some(path) = pathing_grid.get_waypoints_single_goal(start, end, false) {
println!("Waypoints:");
for p in &path {
println!("{:?}", p);
}
println!("\nPath generated from waypoints:");
for p in waypoints_to_path(path) {
println!("{:?}", p);
}
}
println!("\nDirectly computed path");
let expanded_path = pathing_grid
.get_path_single_goal(start, end, false)
.unwrap();
for p in expanded_path {
println!("{:?}", p);
}
}