summaryrefslogtreecommitdiff
path: root/ecs/src/component.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/src/component.rs')
-rw-r--r--ecs/src/component.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/ecs/src/component.rs b/ecs/src/component.rs
index 67ae453..5b1e7f5 100644
--- a/ecs/src/component.rs
+++ b/ecs/src/component.rs
@@ -6,7 +6,7 @@ use seq_macro::seq;
use crate::lock::WriteGuard;
use crate::system::{ComponentRefMut, Input as SystemInput};
use crate::type_name::TypeName;
-use crate::EntityComponent;
+use crate::{EntityComponent, World};
pub mod local;
@@ -143,6 +143,7 @@ pub trait Sequence
fn from_components<'component>(
components: impl Iterator<Item = &'component EntityComponent>,
+ world: &'component World,
) -> Self::Refs<'component>;
}
@@ -203,6 +204,7 @@ pub trait FromOptional<'comp>
{
fn from_optional_component(
optional_component: Option<WriteGuard<'comp, Box<dyn Component>>>,
+ world: &'comp World,
) -> Self;
}
@@ -235,6 +237,7 @@ macro_rules! inner {
fn from_components<'component>(
components: impl Iterator<Item = &'component EntityComponent>,
+ world: &'component World,
) -> Self::Refs<'component>
{
#(
@@ -251,7 +254,7 @@ macro_rules! inner {
}
(#(
- Comp~I::RefMut::from_optional_component(comp_~I),
+ Comp~I::RefMut::from_optional_component(comp_~I, world),
)*)
}
}