hexagon_map/direction/convert.rs
1use super::*;
2use std::ops::{Neg, Not};
3
4impl Not for Orientation {
5 type Output = Self;
6
7 fn not(self) -> Self::Output {
8 match self {
9 Orientation::H(v) => Orientation::H(!v),
10 Orientation::P(v) => Orientation::P(!v),
11 Orientation::Q(v) => Orientation::Q(!v),
12 }
13 }
14}
15
16impl Neg for Orientation {
17 type Output = Self;
18
19 fn neg(self) -> Self::Output {
20 !self
21 }
22}