use std::ops::Not;

pub use 陰陽::*;

pub use 陰陽 as 阴阳;

pub use 陰 as 阴;
pub use 陽 as 阳;

/// ☯
#[repr(u8)]
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
pub enum 陰陽 {
    /// 山南水北，向日爲陽
    陽 = 1,
    /// 山北水南，背日爲陰
    陰 = 0,
}

impl Not for 陰陽 {
    type Output = Self;

    /// 轉陰爲陽，轉陽爲陰
    fn not(self) -> Self::Output {
        match self {
            陰 => 陽,
            陽 => 陰,
        }
    }
}

#[cfg(test)]
mod tests {
    use super::*;

    #[test]
    fn 測試_陰陽() {
        assert_eq!(陰, 阴);
        assert_eq!(陽, 阳);

        assert_eq!(!陰, 陽);
        assert_eq!(!陽, 陰);
    }
}
