summaryrefslogtreecommitdiff
path: root/ecs/src/system/stateful.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ecs/src/system/stateful.rs')
-rw-r--r--ecs/src/system/stateful.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/ecs/src/system/stateful.rs b/ecs/src/system/stateful.rs
index 56c9d4f..26ceaaa 100644
--- a/ecs/src/system/stateful.rs
+++ b/ecs/src/system/stateful.rs
@@ -21,7 +21,7 @@ use crate::tuple::{
TakeOptionElementResult as TupleTakeOptionElementResult,
WithOptionElements as TupleWithOptionElements,
};
-use crate::WorldData;
+use crate::{World, WorldData};
/// A stateful system.
pub struct Stateful<Func>
@@ -92,7 +92,7 @@ macro_rules! impl_system {
)*
}
- fn run<'this>(&'this self, world_data: &'world WorldData)
+ fn run<'this>(&'this self, world: &'world World)
where
'this: 'world
{
@@ -103,7 +103,7 @@ macro_rules! impl_system {
let func = self.func;
func(#({
- TParam~I::new(self, world_data)
+ TParam~I::new(self, &world)
},)*);
}
@@ -111,7 +111,7 @@ macro_rules! impl_system {
{
TypeErased {
data: Box::new(self),
- run: Box::new(|data, world_data| {
+ run: Box::new(|data, world| {
// SAFETY: The caller of TypeErased::run ensures the lifetime
// is correct
let data = unsafe { &*std::ptr::from_ref::<dyn Any>(data) };
@@ -120,11 +120,11 @@ macro_rules! impl_system {
// SAFETY: The caller of TypeErased::run ensures the lifetime
// is correct
- let world_data = unsafe { &*std::ptr::from_ref(world_data) };
+ let world = unsafe { &*std::ptr::from_ref(world) };
- me.run(world_data);
+ me.run(world);
}),
- prepare: Box::new(|data, world_data| {
+ prepare: Box::new(|data, world| {
// SAFETY: The caller of TypeErased::run ensures the lifetime
// is correct
let data = unsafe { &*std::ptr::from_ref::<dyn Any>(data) };
@@ -133,9 +133,9 @@ macro_rules! impl_system {
// SAFETY: The caller of TypeErased::run ensures the lifetime
// is correct
- let world_data = unsafe { &*std::ptr::from_ref(world_data) };
+ let world = unsafe { &*std::ptr::from_ref(world) };
- me.prepare(world_data);
+ me.prepare(world);
}),
}
}