diff options
author | HampusM <hampus@hampusmat.com> | 2025-08-26 16:43:40 +0200 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-09-11 18:24:48 +0200 |
commit | 09981e0173a2427264e432226804292c91e1f920 (patch) | |
tree | 70112b6cda98a55da625ec9f6762927f00affe91 /ecs/src/query/flexible.rs | |
parent | ce1bade2c21cc3129fa8bc2b4bc67bc4dc2c25c3 (diff) |
feat(ecs): add component changed event
Diffstat (limited to 'ecs/src/query/flexible.rs')
-rw-r--r-- | ecs/src/query/flexible.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/ecs/src/query/flexible.rs b/ecs/src/query/flexible.rs index 0caaa27..936ab82 100644 --- a/ecs/src/query/flexible.rs +++ b/ecs/src/query/flexible.rs @@ -36,6 +36,7 @@ impl<'world, const MAX_TERM_CNT: usize> Query<'world, MAX_TERM_CNT> .zip(archetype.entities()) }) as ComponentIterMapFn, ), + world: self.world, } } @@ -65,6 +66,7 @@ impl<'query, const MAX_TERM_CNT: usize> IntoIterator for &'query Query<'_, MAX_T pub struct Iter<'query> { iter: QueryEntityIter<'query>, + world: &'query World, } impl<'query> Iterator for Iter<'query> @@ -75,7 +77,7 @@ impl<'query> Iterator for Iter<'query> { let (archetype, entity) = self.iter.next()?; - Some(EntityHandle::new(archetype, entity)) + Some(EntityHandle::new(archetype, entity, self.world)) } } |