Hello, I'm trying to design a crate for procedural story generation / complex quest system, which is mainly based on a hierarchical task network.
For my own use, I'd probably need hundreds of tasks, and I don't really fancy manually adding each and every one of those tasks' prerequisite update functions (or whatever else I end up doing) to the scheduler.
So I've been trying to find a way to have an indirection layer that would schedule all the needed systems for my tasks.
Is there any way to reference systems in Structs, or better yet, have a Trait's function to be used as a system? Or any other way to link a system to an asset?
A simple function can obviously be used as a system, but I'm more interested in a system that can use Query<> and Res<> for example (I couldn't find how to write a signature that would work).
If it's possible, I'm think of having a system update the internal state of the task, and each node in the task can read the internal state to see if this task has it's preconditions fulfilled. The user would make their own update system and internal state, and the crate would take care of scheduling the update system (through commands.add()), amongst other things.
Obviously, I'm out of my depth, so any advice is welcome.