Skip to content

Commit

Permalink
add version of the ecs's write_world method that takes a pre-boxed …
Browse files Browse the repository at this point in the history
…world writer (bevyengine#661)

Co-authored-by: Nathan Jeffords <njeffords@comtechefdata.com>
  • Loading branch information
2 people authored and joshuajbouw committed Oct 24, 2020
1 parent 08b6d78 commit 87230be
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions crates/bevy_ecs/src/system/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,11 @@ impl CommandsInternal {
}

pub fn write_world<W: WorldWriter + 'static>(&mut self, world_writer: W) -> &mut Self {
self.commands
.push(Command::WriteWorld(Box::new(world_writer)));
self.write_world_boxed(Box::new(world_writer))
}

pub fn write_world_boxed(&mut self, world_writer: Box<dyn WorldWriter + 'static>) -> &mut Self {
self.commands.push(Command::WriteWorld(world_writer));
self
}

Expand Down Expand Up @@ -313,6 +316,11 @@ impl Commands {
self
}

pub fn write_world_boxed(&mut self, world_writer: Box<dyn WorldWriter + 'static>) -> &mut Self {
self.commands.lock().write_world_boxed(world_writer);
self
}

pub fn write_resources<W: ResourcesWriter + 'static>(
&mut self,
resources_writer: W,
Expand Down

0 comments on commit 87230be

Please sign in to comment.