diff options
Diffstat (limited to 'ecs/src')
-rw-r--r-- | ecs/src/entity.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ecs/src/entity.rs b/ecs/src/entity.rs index ca867f9..16f881d 100644 --- a/ecs/src/entity.rs +++ b/ecs/src/entity.rs @@ -163,6 +163,14 @@ impl<'a> Handle<'a> } } + /// Returns whether or not this entity contains a component with the specified `Uid`. + #[must_use] + pub fn has_component(&self, component_uid: Uid) -> bool + { + self.archetype + .contains_component_with_exact_id(component_uid) + } + pub(crate) fn new( archetype: &'a Archetype, entity: &'a ArchetypeEntity, |