A spawn trait for Commands and ChildBuilder #5647
Labels
A-ECS
Entities, components, systems, and events
C-Feature
A new feature, making something new possible
X-Controversial
There is active debate or serious implications around merging this PR
What problem does this solve or what need does it fill?
Both
Commands
andChildBuilder
share the methodsspawn
andspawn_bundle
.In my project I create a
UiExt
that add methods to spawn some ui related structure of entity (e.g. for scrolling list) that look like this :The methods are the same whatever if self is
Commands
orChildBuilder
as long as I can get aEntityCommands
.But because
spawn
is not implemented via a trait I cannot simply use a blanket implementation.What solution would you like?
Expose
spawn
via a trait forCommands
andChildBuilder
.Allowing blanket implementation:
What alternative(s) have you considered?
Add a
spawn
method in myUiExt
trait and manually implement it forCommands
andChildBuilder
.The text was updated successfully, but these errors were encountered: