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
  • Loading branch information
Nathan Jeffords committed Oct 11, 2020
1 parent f6fc76d commit 358e4f9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion crates/bevy_ecs/src/system/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,13 @@ impl CommandsInternal {
}

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

Expand Down Expand Up @@ -313,6 +318,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 358e4f9

Please sign in to comment.