Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow resources to be inserted via tuple #16398

Open
Wuketuke opened this issue Nov 16, 2024 · 1 comment · May be fixed by #16458
Open

Allow resources to be inserted via tuple #16398

Wuketuke opened this issue Nov 16, 2024 · 1 comment · May be fixed by #16458
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Macros Code that generates Rust code D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!

Comments

@Wuketuke
Copy link
Contributor

Wuketuke commented Nov 16, 2024

Whats the problem?

I think it's inconsistent that Systems and Plugins can be inserted via tuple like this, but not Resources:

app.add_plugins((
        DefaultPlugins,
        RapierPhysicsPlugin::<NoUserData>::default(),
        bevy_framepace::FramepacePlugin,
));

I mean sure, it's just a quality of life change, but it really annoys me haha

Implementation

If this proposal is green-lit, I want to try implementing it myself. I will probably do something similar to how Plugin tuples are handled.
I will also update the documentation on App::insert_resource to reflect the change, but I dont know what kind of unit tests i should write, or what other documentation should change, so I'm happy to listen to suggestions.

@Wuketuke Wuketuke added C-Feature A new feature, making something new possible S-Needs-Triage This issue needs to be labelled labels Nov 16, 2024
@BenjaminBrienen BenjaminBrienen added A-ECS Entities, components, systems, and events C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it! D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes D-Straightforward Simple bug fixes and API improvements, docs, test and examples D-Macros Code that generates Rust code and removed S-Needs-Triage This issue needs to be labelled D-Modest A "normal" level of difficulty; suitable for simple features or challenging fixes labels Nov 16, 2024
@BenjaminBrienen
Copy link
Contributor

BenjaminBrienen commented Nov 16, 2024

I'm guessing this involves moving an impl into a macro and using variadics_please::all_tuples!.

@Wuketuke Wuketuke linked a pull request Nov 21, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Feature A new feature, making something new possible C-Usability A targeted quality-of-life change that makes Bevy easier to use D-Macros Code that generates Rust code D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Ready-For-Implementation This issue is ready for an implementation PR. Go for it!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants