condor-for-games 0.4.0

Rust pathfinding library for grids, polygonal scenes, navmeshes, and replanning.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Build once and query a caller-owned static grid.

use condor::{
    Grid, Point, PreparedGridSearch, PreprocessedGridBuilder, SearchRequest, StaticPreparedGrid,
};

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let grid = Grid::new(8, 8)?;
    let prepared = StaticPreparedGrid::builder().preprocess(&grid)?;
    let result = prepared.search(SearchRequest::new(Point::new(0, 0), Point::new(7, 7)))?;
    println!(
        "found={} builder={}",
        result.is_found(),
        prepared.metadata().builder_name
    );
    Ok(())
}