The motivation for this was that it lets us get rid of all the Bevy reflection machinery and the requirement to register every trigger (which makes 'trigger combinators' much harder to use). The downside is that the triggers and transitions now run in an exclusive system, which could be worse for performance. We can ameliorate this using the ComputeTaskPool to spread running the machine across threads.
I also added some functionality tests.
I kept the Reflect bound on MachineState, even though it's probably not necessary, in case it winds up being useful for better debugging information or something later.
(Suggestion: don't review the PR one commit at a time, it's a bit messy; just look at the final diff.)
Breaking changes
TriggerPlugin no longer exists and is not necessary; StateMachinePlugin is all that's needed.
State builders now take their input by value instead of as a reference
Triggers can now only take ReadOnlyStateParams
The Trigger set no longer exists, since we check triggers and run transitions in the same system
The motivation for this was that it lets us get rid of all the Bevy reflection machinery and the requirement to register every trigger (which makes 'trigger combinators' much harder to use). The downside is that the triggers and transitions now run in an exclusive system, which could be worse for performance. We can ameliorate this using the
ComputeTaskPool
to spread running the machine across threads.I also added some functionality tests.
I kept the Reflect bound on MachineState, even though it's probably not necessary, in case it winds up being useful for better debugging information or something later.
(Suggestion: don't review the PR one commit at a time, it's a bit messy; just look at the final diff.)
Breaking changes
TriggerPlugin
no longer exists and is not necessary;StateMachinePlugin
is all that's needed.ReadOnlyStateParam
sTrigger
set no longer exists, since we check triggers and run transitions in the same system