Struct ambient_api_core::ecs::GeneralQueryBuilder
source · pub struct GeneralQueryBuilder<Components: ComponentsTuple + Copy + Clone + 'static>(/* private fields */);
Expand description
Build a GeneralQuery for the ECS. This is how you find entities in the game world.
Implementations§
source§impl<Components: ComponentsTuple + Copy + Clone + 'static> GeneralQueryBuilder<Components>
impl<Components: ComponentsTuple + Copy + Clone + 'static> GeneralQueryBuilder<Components>
sourcepub fn requires(self, requires: impl ComponentsTuple) -> Self
pub fn requires(self, requires: impl ComponentsTuple) -> Self
The entities must include the components in requires
.
sourcepub fn excludes(self, excludes: impl ComponentsTuple) -> Self
pub fn excludes(self, excludes: impl ComponentsTuple) -> Self
The entities must not include the components in exclude
.
sourcepub fn build(self) -> GeneralQuery<Components>
pub fn build(self) -> GeneralQuery<Components>
Builds a GeneralQuery.
sourcepub fn each_frame<R: CallbackReturn>(
self,
callback: impl FnMut(Vec<(EntityId, Components::Data)>) -> R + 'static
) -> Listener
pub fn each_frame<R: CallbackReturn>( self, callback: impl FnMut(Vec<(EntityId, Components::Data)>) -> R + 'static ) -> Listener
Consume this query and call callback
(fn
) each frame with the result of the query.
Auto Trait Implementations§
impl<Components> RefUnwindSafe for GeneralQueryBuilder<Components>where
Components: RefUnwindSafe,
impl<Components> Send for GeneralQueryBuilder<Components>where
Components: Send,
impl<Components> Sync for GeneralQueryBuilder<Components>where
Components: Sync,
impl<Components> Unpin for GeneralQueryBuilder<Components>where
Components: Unpin,
impl<Components> UnwindSafe for GeneralQueryBuilder<Components>where
Components: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more