Added function for flipping CellDir directions

This commit is contained in:
Weird Constructor 2021-07-25 15:53:51 +02:00
parent dda3416a6a
commit 76ab78d565

View file

@ -27,6 +27,18 @@ impl CellDir {
} }
} }
pub fn flip(&self) -> Self {
match self {
CellDir::TR => CellDir::BL,
CellDir::BR => CellDir::TL,
CellDir::B => CellDir::T,
CellDir::BL => CellDir::TR,
CellDir::TL => CellDir::BR,
CellDir::T => CellDir::B,
CellDir::C => CellDir::T,
}
}
#[inline] #[inline]
pub fn is_output(&self) -> bool { pub fn is_output(&self) -> bool {
let e = self.as_edge(); let e = self.as_edge();