use std::fmt;
use binrw::binrw;
#[binrw]
#[brw(little)]
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct LayerIndex(u32);
impl LayerIndex {
pub const NONE: Self = Self(u32::MAX);
pub const fn new(raw: u32) -> Self {
Self(raw)
}
pub const fn value(self) -> u32 {
self.0
}
}
impl fmt::Display for LayerIndex {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0)
}
}
#[binrw]
#[brw(little)]
#[derive(Debug, Clone, Copy, Default, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct WadIndex(u32);
impl WadIndex {
pub const NONE: Self = Self(u32::MAX);
pub const fn new(raw: u32) -> Self {
Self(raw)
}
pub const fn value(self) -> u32 {
self.0
}
}
impl fmt::Display for WadIndex {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
write!(f, "{}", self.0)
}
}