summaryrefslogtreecommitdiff
path: root/ecs/src/actions.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2024-03-12 20:54:42 +0100
committerHampusM <hampus@hampusmat.com>2024-03-12 20:54:42 +0100
commit01066718b0f13846587d26b1869f03e3713082c6 (patch)
tree0ef39b49b26330ab1ed2526105a15c7a0cba7c85 /ecs/src/actions.rs
parent251beb34720d2e7d60ceaddc811a65f52f15bdbd (diff)
feat(ecs): make components internally mutable
Diffstat (limited to 'ecs/src/actions.rs')
-rw-r--r--ecs/src/actions.rs12
1 files changed, 8 insertions, 4 deletions
diff --git a/ecs/src/actions.rs b/ecs/src/actions.rs
index d67f895..edfee55 100644
--- a/ecs/src/actions.rs
+++ b/ecs/src/actions.rs
@@ -9,7 +9,7 @@ use crate::WorldData;
#[derive(Debug)]
pub struct Actions<'world>
{
- world_data: &'world mut WorldData,
+ world_data: &'world WorldData,
}
impl<'world> Actions<'world>
@@ -19,6 +19,7 @@ impl<'world> Actions<'world>
{
self.world_data
.action_queue
+ .borrow_mut()
.push(Action::Spawn(components.into_vec()));
}
}
@@ -28,13 +29,16 @@ unsafe impl<'world> SystemParam<'world> for Actions<'world>
type Flags = NoInitParamFlag;
type Input = TupleFilterExclude;
- fn initialize<SystemImpl>(_system: &mut impl System<SystemImpl>, _input: Self::Input)
+ fn initialize<SystemImpl>(
+ _system: &mut impl System<'world, SystemImpl>,
+ _input: Self::Input,
+ )
{
}
fn new<SystemImpl>(
- _system: &'world mut impl System<SystemImpl>,
- world_data: &'world mut WorldData,
+ _system: &'world impl System<'world, SystemImpl>,
+ world_data: &'world WorldData,
) -> Self
{
Self { world_data }