From 06423b67c8c3f4e827d5fbe6d81b74453723811e Mon Sep 17 00:00:00 2001 From: Nathan Jeffords Date: Sun, 11 Oct 2020 10:49:13 -0700 Subject: [PATCH] add version of the ecs's `write_world` method that takes a pre-boxed world writer --- crates/bevy_ecs/src/system/commands.rs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/crates/bevy_ecs/src/system/commands.rs b/crates/bevy_ecs/src/system/commands.rs index 04e68b002d88d..90cab955f5e76 100644 --- a/crates/bevy_ecs/src/system/commands.rs +++ b/crates/bevy_ecs/src/system/commands.rs @@ -219,8 +219,11 @@ impl CommandsInternal { } pub fn write_world(&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) -> &mut Self { + self.commands.push(Command::WriteWorld(world_writer)); self } @@ -313,6 +316,11 @@ impl Commands { self } + pub fn write_world_boxed(&mut self, world_writer: Box) -> &mut Self { + self.commands.lock().write_world_boxed(world_writer); + self + } + pub fn write_resources( &mut self, resources_writer: W,