Skip to content

Simpler custom commands #2899

Description

@alice-i-cecile

What problem does this solve or what need does it fill?

Custom commands are cumbersome and bulky to work with. See book draft for current design.

What solution would you like?

impl Command for <impl FnOnce(&mut World)>

This could be used for simple one-off use-cases where the whole struct + trait extension pattern is too heavy.

What alternative(s) have you considered?

Running systems as commands has similar effects, see #2234. However, it has higher overhead and is not well-suited to reusing custom entity spawning / other archetype modifying logic (unless we use it to insert new exclusive systems).

Additional context

Idea credit @TheRawMeatball.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-UsabilityA targeted quality-of-life change that makes Bevy easier to useD-TrivialNice and easy! A great choice to get started with BevyS-Ready-For-ImplementationThis issue is ready for an implementation PR. Go for it!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions