Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Commands::run_schedule #16537

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bushrat011899
Copy link
Contributor

@bushrat011899 bushrat011899 commented Nov 28, 2024

Objective

Solution

  • Added Commands::run_schedule, which internally calls World::try_run_schedule, logging any issues.

Testing

  • Added doctest
  • Ran CI

Showcase

Instead of writing:

commands.queue(|world: &mut World| world.run_schedule(FooSchedule));

You can now write:

commands.run_schedule(FooSchedule);

Convenience method wrapping `World::try_run_schedule`
@bushrat011899 bushrat011899 added C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy A-ECS Entities, components, systems, and events X-Uncontroversial This work is generally agreed upon S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Nov 28, 2024
@bushrat011899 bushrat011899 added this to the 0.16 milestone Nov 28, 2024
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not just unwrapping I see :P I think this is good default behavior, but we'll need to come back and change this when we tackle command error handling.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Nov 28, 2024
@bushrat011899
Copy link
Contributor Author

Not just unwrapping I see :P I think this is good default behavior, but we'll need to come back and change this when we tackle command error handling.

I was half tempted to do // TODO: commands need a coherent error handling policy but I thought I'd just sneak in my preferred solution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible D-Trivial Nice and easy! A great choice to get started with Bevy S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it X-Uncontroversial This work is generally agreed upon
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Commands::run_schedule
3 participants