-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished
Description
What problem does this solve or what need does it fill?
Even when working with exclusive world access, work often needs to be deferred to satisfy soundness.
This occurs most commonly when iterating over a query or in other looping contexts.
What solution would you like?
Add World::commands(), which fetches a fresh instance of Commands.
Add World::apply_commands(), for a simple
What alternative(s) have you considered?
This is a partial, tightly-scoped alternative to some of the frustrations that inspired bevyengine/rfcs#42.
Additional context
World::apply_commands can currently be achieved with this snippet:
use bevy::prelude::*;
use bevy::ecs::system::SystemState;
let world = World::new();
let mut system_state = SystemState::<Commands>::new(&mut world);
// Manually adding a command to the list to verify that this works
let mut commands = system_state.get_mut();
commands.spawn();
// Applies all accumulated commands to the world, causing them to take immediate effect
system_state.apply(&mut world);nkzawa, CyriacBr and Pietrek14
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useS-Needs-DesignThis issue requires design work to think about how it would best be accomplishedThis issue requires design work to think about how it would best be accomplished