use super::RotateDirections;
#[cfg_attr(all(feature = "strum"), derive(strum::EnumIter))]
#[cfg_attr(all(feature = "enum_ext"), enum_ext::enum_extend)]
#[cfg_attr(feature = "bitcode", derive(bitcode::Encode, bitcode::Decode))]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Default, Hash, PartialOrd, Ord)]
#[cfg_attr(feature = "c_compatible", repr(C))]
pub enum Directions {
#[default]
North,
East,
South,
West,
}
impl const RotateDirections for Directions {
fn rotate_clockwise_90(&self) -> Self {
match self {
Self::North => Self::East,
Self::East => Self::South,
Self::South => Self::West,
Self::West => Self::North,
}
}
fn rotate_counterclockwise_90(&self) -> Self {
match self {
Self::North => Self::West,
Self::East => Self::North,
Self::South => Self::East,
Self::West => Self::South,
}
}
}