System run condition if several resources exist ergonomics
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## What problem does this solve or what need does it fill?
If a system depends on some amount of resources before it should run, the ergonomics are not _super_ great:
```rust
my_system.run_if(resource_exists::().and_then(resource_exists::()).and_then(resource_exists::())),
```
## What solution would you like?
If possible, perhaps tuple type magic could make it more ergonomic:
```rust
my_system.run_if(resources_exist::<(A, B, C)>()),
```
## What alternative(s) have you considered?
Using the more verbose approach.
## Additional context
Idea from here:
https://github.com/bevyengine/bevy/issues/10762#issuecomment-1830065108
Contributor guide
Research direction
Start by examining the existing resource_exists::...().and_then(...) run-condition API and the related discussion in issue #10762. Determine whether a resources_exist::<(A, B, C)>() form can support the same behavior; done means the multi-resource condition is available with the proposed tuple ergonomics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100