Feature Idea: Actions #5870
JonahPlusPlus
started this conversation in
Ideas
Replies: 1 comment
-
I've considered making the trait into: trait Action: Reflect {
fn do(&self, &mut World);
fn undo(&self, &mut World) {}
} but this would limit it to just exclusive execution. By making it more system-like, actions could be done when there are openings for execution (inclusively). |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have this idea for an action system in Bevy. I'm trying to create an RFC for this and would like to get some feedback.
It's essentially a mix between Events and Systems. The key point is that it allows for ordering behavior.
For instance, the issue I see with Events is if someone does two events on the same frame, there is no guarantee of order.
Ex: A "rotate" and "move on local axis" events are sent out, in that order. There might be two systems "handle_rotate" and "handle_move" but they won't necessarily execute in the order of events.
This could be designed to work by the crate maintainer, but what if these events are in different crates?
Well, why would you want to dispatch actions to rotate and move anyways? Why not just rotate and move on input?
For instance, for the future editor, I see the possibility of doing things from the GUI, the CLI or an action palette (like VSCode's command palette). Instead of making system(s) that check for the user using any of these things for each action, it would possible to register actions for buttons, the CLI and command palette.
RENDERED
I want to know if there is already ideas/alternatives on how such a system would work.
Beta Was this translation helpful? Give feedback.
All reactions