diff options
Diffstat (limited to 'ecs/src/lib.rs')
-rw-r--r-- | ecs/src/lib.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ecs/src/lib.rs b/ecs/src/lib.rs index df65cb3..04c9b9f 100644 --- a/ecs/src/lib.rs +++ b/ecs/src/lib.rs @@ -170,6 +170,19 @@ impl World component_storage_lock .add_components_to_entity(entity_uid, components); } + Action::RemoveComponents(entity_uid, component_ids) => { + let mut component_storage_lock = + self.data.component_storage.write_nonblock().expect( + "Failed to acquire read-write component storage lock", + ); + + component_storage_lock.remove_components_from_entity( + entity_uid, + component_ids + .iter() + .map(|component_metadata| component_metadata.id), + ); + } Action::Stop => { self.stop.store(true, Ordering::Relaxed); } |