-
-
Couldn't load subscription status.
- Fork 4.2k
Closed as not planned
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 useX-ControversialThere is active debate or serious implications around merging this PRThere is active debate or serious implications around merging this PR
Description
What problem does this solve or what need does it fill?
There are many different methods to control the execution flow of a system set. I think many of them could be unified into an easy and intuitive API. For example, "piping" and "chaining" systems is essentially the same thing: you could look at "chaining" as piping () . Ideally, these two concepts should be merged into a nice and consistent API.
What solution would you like?
I think we can achieve a really nice looking API by utilizing the Shr (or Shl) traits.
For example:
Simple chaining
// Before:
(sys1, sys2, sys3).chain()
// After:
sys1 >> sys2 >> sys3Simple piping
// Before:
sys1.pipe(sys2).pipe(sys3)
// After:
sys1 >> sys2 >> sys3Complex chaining + piping
// Before:
(((sys1, sys2, sys3).chain(), sys4, sys5.pipe(sys6)), sys7).chain()
// After:
(sys1 >> sys2 >> sys3, sys4, sys5 >> sys6) >> sys7What alternative(s) have you considered?
Keep the API as is
Additional context
- We can also use declarative macros. That would offer more flexibility, but it will be harder to implement and maintain (and it's not guaranteed to make the API feel better)
- This could open the gate for "1-N piping" (piping the output of a system into many systems)
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 useX-ControversialThere is active debate or serious implications around merging this PRThere is active debate or serious implications around merging this PR