diff options
author | HampusM <hampus@hampusmat.com> | 2025-03-23 20:01:28 +0100 |
---|---|---|
committer | HampusM <hampus@hampusmat.com> | 2025-03-23 20:01:56 +0100 |
commit | fd3e5efa4609b1eabd3d982099293e04a80a1ee7 (patch) | |
tree | 780ae2b19a0bc6e2df4c03b923a9d0e8e424a42d /ecs/src/component/storage | |
parent | 98c9c63f2471fb6662e8c542762d4f6caf4fb7cd (diff) |
feat(ecs): add integration with vizoxide crate
Diffstat (limited to 'ecs/src/component/storage')
-rw-r--r-- | ecs/src/component/storage/graph.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/ecs/src/component/storage/graph.rs b/ecs/src/component/storage/graph.rs index a221877..11160e7 100644 --- a/ecs/src/component/storage/graph.rs +++ b/ecs/src/component/storage/graph.rs @@ -71,6 +71,12 @@ impl Graph })) } + #[cfg(feature = "vizoxide")] + pub fn iter_nodes(&self) -> impl Iterator<Item = &ArchetypeNode> + { + self.nodes.iter() + } + pub fn dfs_archetype_add_edges( &self, archetype_id: ArchetypeId, @@ -233,6 +239,12 @@ impl ArchetypeNode self.edges.entry(component_id).or_insert_with(insert_fn) } + #[cfg(feature = "vizoxide")] + pub fn iter_edges(&self) -> impl Iterator<Item = (&Uid, &ArchetypeEdges)> + { + self.edges.iter() + } + pub fn get_edges_mut(&mut self, component_id: Uid) -> Option<&mut ArchetypeEdges> { debug_assert_eq!(component_id.kind(), UidKind::Component); |