amethyst / shred

Shared resource dispatcher
Apache License 2.0
233 stars 66 forks source link

Add getters to DispatcherBuilder #215

Closed SebastienGllmt closed 2 years ago

SebastienGllmt commented 2 years ago

For our system graph, it's possible that in the end no system actually needs to be executed at the given moment. To avoid the overhead of calling dispatcher.dispatch(&world) on an empty graph, I wanted to add an is_empty function that I can call before executing.

Similar, some systems may not need to run at some given time. There are times in my code where a child task needs to run even if its dependency did not need to execute, and there are times where it doesn't need to run. In order to implement this logic, I added a has_system function so that I can check whether or not a dependency was skipped