summaryrefslogtreecommitdiff
path: root/ecs/src/component/storage.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2025-04-05 16:32:57 +0200
committerHampusM <hampus@hampusmat.com>2025-04-05 16:32:57 +0200
commitf67ccdd0e10cfde6851610d5d96008c8a0a50ab6 (patch)
treec4ca8ec51d42728846505546ca0a072b57801305 /ecs/src/component/storage.rs
parent523d13eec4778bb0d5e25416f09f2e5f7fc27ca7 (diff)
refactor(ecs): make only component storage graph fns set node edgesHEADmaster
Diffstat (limited to 'ecs/src/component/storage.rs')
-rw-r--r--ecs/src/component/storage.rs24
1 files changed, 1 insertions, 23 deletions
diff --git a/ecs/src/component/storage.rs b/ecs/src/component/storage.rs
index 40909fb..0a6382b 100644
--- a/ecs/src/component/storage.rs
+++ b/ecs/src/component/storage.rs
@@ -212,17 +212,12 @@ impl Storage
None => {
let archetype_node = self
.graph
- .get_node_by_id_mut(archetype_id)
+ .get_node_by_id(archetype_id)
.expect("Archetype should exist");
let (add_edge_id, add_edge_comp_ids) =
archetype_node.make_add_edge(component_id);
- archetype_node
- .get_edges_mut(component_id)
- .expect("Edges for component in archetype should exist")
- .add = Some(add_edge_id);
-
if !self.graph.contains_archetype(add_edge_id) {
self.graph.create_node(add_edge_id, &add_edge_comp_ids);
}
@@ -231,18 +226,6 @@ impl Storage
}
};
- {
- let add_edge_archetype_node = self
- .graph
- .get_node_by_id_mut(add_edge_archetype_id)
- .expect("Add edge archetype should exist");
-
- let add_edge_archetype_edges = add_edge_archetype_node
- .get_or_insert_edges(component_id, ArchetypeEdges::default);
-
- add_edge_archetype_edges.remove = Some(archetype_id);
- }
-
let archetype_node = self
.graph
.get_node_by_id_mut(archetype_id)
@@ -312,11 +295,6 @@ impl Storage
let (remove_edge_id, remove_edge_comp_ids) =
archetype_node.make_remove_edge(component_id);
- archetype_node
- .get_edges_mut(component_id)
- .expect("Edges for component in archetype should exist")
- .remove = Some(remove_edge_id);
-
if !self.graph.contains_archetype(remove_edge_id) {
self.graph
.create_node(remove_edge_id, &remove_edge_comp_ids);