move all doors to the ends of corridors
This commit is contained in:
parent
7a27321bec
commit
190543a361
2 changed files with 69 additions and 21 deletions
|
|
@ -85,6 +85,15 @@ impl Direction {
|
|||
Direction::West => Point::new(-1, 0),
|
||||
}
|
||||
}
|
||||
pub fn opposite_dir(&self) -> Direction {
|
||||
match self {
|
||||
Direction::NoDir => unreachable!("Direction::NoDir has no opposite."),
|
||||
Direction::North => Direction::South,
|
||||
Direction::East => Direction::West,
|
||||
Direction::South => Direction::North,
|
||||
Direction::West => Direction::East,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pub struct DirectionIterator {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue