Skip to content

Commit

Permalink
ecs: add ability to set the current entity in world builders
Browse files Browse the repository at this point in the history
  • Loading branch information
cart committed Jun 25, 2020
1 parent 4a0f8b8 commit dfde160
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions crates/bevy_core/src/transform/world_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ impl<'a> WorldBuilder<'a> {
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
pub fn with<T>(&mut self, component: T) -> &mut Self
where
Expand Down Expand Up @@ -114,6 +119,11 @@ impl<'a> CommandBufferBuilder<'a> {
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
pub fn with<T>(&mut self, component: T) -> &mut Self
where
Expand Down

0 comments on commit dfde160

Please sign in to comment.