ecs: add ability to set the current entity in world builders

This commit is contained in:
Carter Anderson 2020-06-25 13:23:28 -07:00
parent 4a0f8b8869
commit dfde160741

View File

@ -34,6 +34,11 @@ impl<'a> WorldBuilder<'a> {
self self
} }
pub fn set_entity(&mut self, entity: Entity) -> &mut Self {
self.current_entity = Some(entity);
self
}
/// note: this is slow and does a full entity copy /// note: this is slow and does a full entity copy
pub fn with<T>(&mut self, component: T) -> &mut Self pub fn with<T>(&mut self, component: T) -> &mut Self
where where
@ -114,6 +119,11 @@ impl<'a> CommandBufferBuilder<'a> {
self self
} }
pub fn set_entity(&mut self, entity: Entity) -> &mut Self {
self.current_entity = Some(entity);
self
}
// note: this is slow and does a full entity copy // note: this is slow and does a full entity copy
pub fn with<T>(&mut self, component: T) -> &mut Self pub fn with<T>(&mut self, component: T) -> &mut Self
where where