Add Component::is_entity and is::relation

main
copygirl 2 months ago
parent 64f6b7467e
commit c7b7084c32
  1. 12
      src/ecs/component.rs

@ -37,6 +37,18 @@ impl Component {
unsafe { Flags::from_bits_masked(self.high) } unsafe { Flags::from_bits_masked(self.high) }
} }
#[inline]
#[must_use]
pub fn is_entity(&self) -> bool {
self.flags() == Flags::NONE
}
#[inline]
#[must_use]
pub fn is_relation(&self) -> bool {
self.flags() == Flags::RELATION
}
#[inline] #[inline]
#[must_use] #[must_use]
pub fn to_bits(&self) -> u64 { pub fn to_bits(&self) -> u64 {

Loading…
Cancel
Save