bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Add `ApplyCommands` (#6184)

Open Zeenobit opened this issue 3 years ago • 4 comments

Objective

Fixed #6184

Solution

This PR adds an ApplyCommands trait which is implemented for &mut World and &mut App. It allows the user to do this:

let mut world = World::default();
let _ = world.apply_commands(|_world, mut commands| {
    /* ... */
});

Initially this PR was posted as #6186. I accidentally deleted the repo, so this is the replacement. I also took this chance to rename Execute to ApplyCommands because I think it matches better with existing terminology, and simplified how_to_test_commands.rs.

Zeenobit avatar Jan 20 '23 19:01 Zeenobit

As a heads up, I just added Schedule::apply_system_buffers in #7267 (because pipelined rendering needs it). We should wait and see how that shakes out, and then decide whether this is still needed post-Stageless.

alice-i-cecile avatar Jan 20 '23 23:01 alice-i-cecile

This is no longer blocked!

alice-i-cecile avatar Feb 23 '23 14:02 alice-i-cecile

Not sure what's going on with the validation here. This is already moved to bevy_ecs.

Zeenobit avatar Mar 10 '23 17:03 Zeenobit

Yeah pushing a new commit will probably reset CI: we changed it quite a bit (to remove bors) since your last push.

alice-i-cecile avatar Mar 10 '23 18:03 alice-i-cecile

@alice-i-cecile Is there anything blocking the integration of this from my end? As far as I can tell all the review concerns have been addressed.

Zeenobit avatar Jun 05 '23 17:06 Zeenobit

Closing in favor of run_system based on feedback.

Zeenobit avatar Jun 10 '23 18:06 Zeenobit