DynamicBundle
Might need some documentation, I'm not familiar with the that @caelunshun is using. Resolves #375
The Game::spawn could also be optimized to not use entity builder and reduce the number of host calls required.
Which in turn could also be used to improve the EntityBuilder.
I would like to have a single spawn function on game, that can take PiglinBundle, Component, and or any combination of components and bundles. Without specialisation there is no way to make a blank ComponentBundle implementation for Components, I suggest that Component: ComponentBundle such that a Component is also a bundle, but it only adds it self to the entity.
If this is an acceptable solution, the next step for me would be to create bundles for all EntityInit variants. Maybe update the EntityBuilder to only require one host call, instead of a host call to initialize the builder and for each added component.
The bundles would look something like
struct PiglinBundle {
piglin: Piglin,
uuid: Uuid,
position: Position,
}
Should I manually implement these or add an derive ComponentBundle (maybe rename ComponentBundle to Bundle)?
@caelunshun where did we land on this. Right now I have moved bundles into common such that I can make a blanket ComponentBundle implementation for Component. Should the function still be renamed to spawn_bundle or should we move to exclusively use bundles?