Skip to content

Commit

Permalink
feat/fix(observer_builder): add specific observer_flags
Browse files Browse the repository at this point in the history
  • Loading branch information
Indra-db committed Nov 16, 2024
1 parent 6ffa92e commit 3cc3ef3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion flecs_ecs/src/core/observer_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ impl<'a, P, T: QueryTuple> ObserverBuilder<'a, P, T> {
///
/// * C++ API: `query_builder_i::filter_flags`
#[doc(alias = "query_builder_i::filter_flags")]
fn observer_flags(&mut self, flags: QueryFlags) -> &mut Self {
fn observer_flags(&mut self, flags: ObserverFlags) -> &mut Self {
self.desc.flags_ |= flags.bits();
self
}
Expand Down
9 changes: 9 additions & 0 deletions flecs_ecs/src/core/query_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ bitflags::bitflags! {
}
}

bitflags::bitflags! {
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
pub struct ObserverFlags: u32 {
const BypassQuery = sys::EcsObserverBypassQuery;
const YieldOnCreate = sys::EcsObserverYieldOnCreate;
const YieldOnDelete = sys::EcsObserverYieldOnDelete;
}
}

impl<'a, T> QueryBuilder<'a, T>
where
T: QueryTuple,
Expand Down

0 comments on commit 3cc3ef3

Please sign in to comment.