summaryrefslogtreecommitdiff
path: root/ecs/src
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2025-01-02 15:29:02 +0100
committerHampusM <hampus@hampusmat.com>2025-01-02 15:29:02 +0100
commitcd32eab01d731c7ec16fd8060a1ebc7bfe4585c2 (patch)
treea1747f696f2ededee8bff1b02caf1a4107f52f3c /ecs/src
parentcb57a9f10ed61222709517a9ae0f6dd75a2c2ebd (diff)
refactor(ecs): rename find_entities to iter_archetypes_with_comps
Diffstat (limited to 'ecs/src')
-rw-r--r--ecs/src/component/storage.rs2
-rw-r--r--ecs/src/query.rs8
2 files changed, 5 insertions, 5 deletions
diff --git a/ecs/src/component/storage.rs b/ecs/src/component/storage.rs
index cb219f1..e939ba7 100644
--- a/ecs/src/component/storage.rs
+++ b/ecs/src/component/storage.rs
@@ -27,7 +27,7 @@ pub struct Storage
impl Storage
{
- pub fn find_entities<CompMetadataList>(
+ pub fn iter_archetypes_with_comps<CompMetadataList>(
&self,
mut comp_metadata_list: CompMetadataList,
) -> ArchetypeRefIter<'_>
diff --git a/ecs/src/query.rs b/ecs/src/query.rs
index c4b4cf0..3905fb8 100644
--- a/ecs/src/query.rs
+++ b/ecs/src/query.rs
@@ -50,7 +50,7 @@ where
world: self.world,
entities: self
.component_storage
- .find_entities(Comps::metadata())
+ .iter_archetypes_with_comps(Comps::metadata())
.map(
(|archetype| {
repeat_n(archetype, archetype.entity_cnt())
@@ -75,7 +75,7 @@ where
world: self.world,
entities: self
.component_storage
- .find_entities(Comps::metadata())
+ .iter_archetypes_with_comps(Comps::metadata())
.map(
(|archetype| {
repeat_n(archetype, archetype.entity_cnt())
@@ -107,7 +107,7 @@ where
world: self.world,
entities: self
.component_storage
- .find_entities(
+ .iter_archetypes_with_comps(
Comps::metadata()
.into_iter()
.chain(extra_components)
@@ -131,7 +131,7 @@ where
{
Some(
self.component_storage
- .find_entities(Comps::metadata())
+ .iter_archetypes_with_comps(Comps::metadata())
.flat_map(|archetype| archetype.entities())
.filter(|entity| OptionsT::entity_filter(entity.components()))
.nth(entity_index)?