feat(pathfinding): use pathfinding crate

This commit is contained in:
2025-01-14 11:58:59 +02:00
parent 6cd7550086
commit 4eab4d1198
7 changed files with 98 additions and 166 deletions

16
tests/pathfinding.rs Normal file
View File

@@ -0,0 +1,16 @@
use claims::*;
use hexlab::MazeBuilder;
use hexx::{hex, Hex};
#[test]
fn basic_path() {
let maze = assert_ok!(MazeBuilder::new().with_seed(12345).with_radius(5).build());
let start = Hex::new(0, 0);
let goal = Hex::new(2, 0);
assert_some_eq!(
maze.find_path(start, goal),
vec![start, hex(1, 0), hex(1, 1), hex(2, 1), goal]
);
}