use super::Display;
bitflags::bitflags! {
#[cfg_attr(rustfmt, rustfmt_skip)]
#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
#[derive(Display)]
#[repr(align(8))]
pub struct Locks: u8 {
const DRIVER = 0b00000001;
const PASSENGER = 0b00000010;
const REAR_DRIVER = 0b00000100;
const REAR_PASSENGER = 0b00001000;
const MYSTERY_DOOR_0 = 0b00010000;
const SWING_GATE = 0b00100000;
const MYSTERY_DOOR_1 = 0b01000000;
const MYSTERY_DOOR_2 = 0b10000000;
const ALL_JEEP_DOORS = 0b00101111;
}
}
impl Locks {
#[inline]
pub const fn all_locked(self) -> bool {
self.intersection(Self::ALL_JEEP_DOORS).is_empty()
}
#[inline]
pub const fn any_unlocked(self) -> bool {
!self.all_locked()
}
}