Skip to content

Increase structure for schedule executors to reduce boilerplate and ensure consistency #18453

Open
@alice-i-cecile

Description

@alice-i-cecile

Problem

When implementing a new system executor, users (and engine devs) need to ensure a wide array of functionality and behavior is followed. These requirements are scattered across bevy_ecs, leading to "copy-paste an existing executor" as the only sensible strategy.

Similarly, when attempting to make changes to this code, engine devs need to go and carefully manually implement these changes across multiple call sites, being sure to maintain consistency.

Proposed solution

More behavior should be moved out of SystemExecutor::run, and into new methods on the SystemExecutor trait. Ideally, SystemExecutor::run's default implementation can call all of these submethods in order to achieve the correct behavior.

Additionally, evaluate_and_fold_conditions should be moved out into a public helper and reused across executors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-ECSEntities, components, systems, and eventsC-Code-QualityA section of code that is hard to understand or changeD-ModestA "normal" level of difficulty; suitable for simple features or challenging fixesS-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