-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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 API for simple system ordering #5165
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some doc nits. I'm not confident enough with macros and system internals to do a full review though.
/// | ||
/// [`.link()`]: IntoLinkedSystemSet::link | ||
pub trait IntoLinkedSystemSet<S, P> { | ||
/// A helper method to create system sets with automatic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// A helper method to create system sets with automatic | |
/// A helper method to create system sets with sequential |
/// | ||
/// [`.then()`]: IntoSequentialSystemSet::then | ||
pub trait IntoSequentialSystemSet<S0, S1, P0, P1> { | ||
/// A helper method to create system sets with automatic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/// A helper method to create system sets with automatic | |
/// A helper method to create system sets with sequential |
Nice work! I'll do a full review soon. Did you experiment with the .then() syntax as well? |
I’m not up-to-date on bevyengine/rfcs#45 but isn't the terminology |
Yes, but to do that we'll need to first rename the existing system chaining :) |
This seems awfully similar to earlier iterations of #2381 before it was extended to support fan-in/fan-out topologies: strictly sequential, no graph ordering. While the |
Hello, sorry for the late response. I was not aware of #2381 and bevyengine/rfcs#45, whoops sorry. In hindsight, this is a very naive way of implementing sequential chains of system. I honestly think that there should be an easier way of making a linear sequential order of systems, but with the rfc I probably think it would be for the best that we should wait until stageless is implemented. However, I think the proc-macro I made for this should be useful in implementing |
Closing as this has been done in the stageless rework. |
Objective
Solution
IntoLinkedSystemSet
andIntoSequentialSystemSet
.SystemSet
that can be added toApp
throughApp::add_system_set
.IntoLinkedSystemSet
IntoLinkedSystemSet
is a trait that provides a methodlink()
.IntoLinkedSystemSet
is implemented on tuples of systems containing 2 to 15 elements.Syntax:
This is equal to:
IntoSequentialSystemSet
IntoSequentialSystemSet
is trait that provides a methodthen(next_system)
IntoSequentialSystemSet
is implemented on a system, and accepts a system.Syntax:
This is equal to:
Or
Known Limitations
IntoSequentialSystemSet
is not implemented forSystemSet
. This means you can't dosystem_a.then(system_b).then(system_c)
.IntoLinkedSystemSet
is not implemented for tuples with more than 15 elements.Changelog
Added
IntoSequentialSystemSet::then
and doingsystem_a.then(system_b)
.IntoLinkedSystemSet::link
on tuples of systems.