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

Introduce public World::register_dynamic_bundle method #18198

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

urben1680
Copy link
Contributor

@urben1680 urben1680 commented Mar 8, 2025

Registering dynamic bundles was not possible for the user yet.

It is alone not very useful though as there are no methods to clone, move or remove components via a BundleId. This could be a follow-up work if this PR is approved and such a third (besides T: Bundle and ComponentId(s)) API for structural operation is desired. I certainly would use a hypothetical EntityClonerBuilder::allow_by_bundle_id.

I personally still would like this register method because I have a Bundles-like custom data structure and I would like to not reinvent the wheel. Then instead of having boxed ComponentId slices in my collection I could look up explicit and required components there.

For reference scroll up to the typed version right above the new one.

@urben1680 urben1680 changed the title introduce public World::register_dynamic_bundle Introduce public World::register_dynamic_bundle method Mar 8, 2025
@IQuick143 IQuick143 added C-Feature A new feature, making something new possible A-ECS Entities, components, systems, and events S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Unsafe Touches with unsafe code in some way D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Mar 8, 2025
@urben1680
Copy link
Contributor Author

If this is too little to add, I can also extend EntityClonerBuilder and add remove_by_bundle_id to EntityCommands/EntityWorldMut.

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 D-Straightforward Simple bug fixes and API improvements, docs, test and examples D-Unsafe Touches with unsafe code in some way S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants