Add PathFinder trait
This commit is contained in:
parent
5c8010c23b
commit
08eb0a8e11
8 changed files with 688 additions and 373 deletions
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue