summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-12-08 21:56:13 +0100
committerHampusM <hampus@hampusmat.com>2024-12-08 21:56:13 +0100
commit82123b59e0be2fa10db04a6b1d7798382cbc0686 (patch)
treefc0636a42b2e39f3f9b3de9d1d308f71c6ad8cc7
parentc00ebc000ecc76a6f9fdd7bdff9641b89dc3dee4 (diff)
refactor(ecs): make query options entity_filter fn take slice
-rw-r--r--ecs/src/query/options.rs16
1 files changed, 4 insertions, 12 deletions
diff --git a/ecs/src/query/options.rs b/ecs/src/query/options.rs
index bbbe0a8..ead0ac7 100644
--- a/ecs/src/query/options.rs
+++ b/ecs/src/query/options.rs
@@ -7,16 +7,12 @@ use crate::EntityComponent;
/// Query options.
pub trait Options
{
- fn entity_filter<'component>(
- components: impl IntoIterator<Item = &'component EntityComponent>,
- ) -> bool;
+ fn entity_filter<'component>(components: &'component [EntityComponent]) -> bool;
}
impl Options for ()
{
- fn entity_filter<'component>(
- _: impl IntoIterator<Item = &'component EntityComponent>,
- ) -> bool
+ fn entity_filter<'component>(_components: &'component [EntityComponent]) -> bool
{
true
}
@@ -33,9 +29,7 @@ impl<ComponentT> Options for With<ComponentT>
where
ComponentT: Component,
{
- fn entity_filter<'component>(
- components: impl IntoIterator<Item = &'component EntityComponent>,
- ) -> bool
+ fn entity_filter<'component>(components: &'component [EntityComponent]) -> bool
{
let ids_set = components
.into_iter()
@@ -57,9 +51,7 @@ impl<OptionsT> Options for Not<OptionsT>
where
OptionsT: Options,
{
- fn entity_filter<'component>(
- components: impl IntoIterator<Item = &'component EntityComponent>,
- ) -> bool
+ fn entity_filter<'component>(components: &'component [EntityComponent]) -> bool
{
!OptionsT::entity_filter(components)
}