-
Notifications
You must be signed in to change notification settings - Fork 84
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
Feature: re-usable component bundles #193
Comments
I think this is widely useful, so I'm interested in having it. In particular, it makes it easy to repeatedly spawn individual entities based on a dynamically-loaded prototype with minimal boilerplate. I believe this is the second time I've received this specific request. However, it represents a significant API design challenge. As a baseline, this could be accomplished by duplicating most of What we need is some way to abstract |
As an aside, a somewhat inefficient but easy, stable, and safe workaround for this issue could look something like |
The EntityBuilderClone is extremely useful. Although it is not published on crates.io. Is it possible to include it in a non breaking minor release? |
Glad to hear it's helpful! Is there some specific breakage you're concerned about? I was planning on cutting 0.7 very soon; I can backport to 0.6 if necessary, but I'd be surprised if the upgrade presented a problem. |
Not specifically. I am developing a game engine using hecs and making a template system, which is why reusable builders would be phenomenal. I am also planning on writing a pipelining crate for hecs to allow for multithreaded schedules with systems. This also links back to issue #19 and weather I should include a commanbuffer provided by the scheduler, or if the world should supply one. |
I've now published 0.7.0. Sounds like you might be interested in the new |
Absolutely zero breakages in https://github.com/ten3roberts/ivy, and one compile time breakage in https://github.com/ten3roberts/hecs-hierarchy relating to Splendid work 👍 |
Great! |
I'd like to efficiently re-use component bundles that aren't known statically.
Implementing
DynamicBundle
myself seems painful and not intended.Re-using can only happen if all of the components are
Clone
.Ideally, we'd have
impl DynamicBundle for &'a EntityBuilder
if we know that all of the components are cloneable. This would allow me to just keep anEntityBuilder
around and use it as a bundle.The text was updated successfully, but these errors were encountered: