Add PathFinder trait

This commit is contained in:
hal8174 2025-01-28 21:54:20 +01:00
parent 5c8010c23b
commit 08eb0a8e11
8 changed files with 688 additions and 373 deletions

View file

@ -26,6 +26,7 @@ pub trait Visualize {
}
}
#[derive(Debug, Clone, Copy)]
pub enum Symbol {
Arrow(Direction),
ArrowEnter(Direction),
@ -131,6 +132,16 @@ impl Visualization {
}
}
pub fn overlay_visualization(&mut self, other: &Self) {
self.size = Position::new(
PositionType::max(self.size.x, other.size.x),
PositionType::max(self.size.y, other.size.y),
);
self.symbols
.extend(other.symbols.iter().map(|(&k, &v)| (k, v)));
}
pub fn size(&self) -> Position {
self.size
}