Open
Description
What problem does this solve or what need does it fill?
Currently there is no way to add multiple relationships with one entity using the new RelationshipTarget
If I wanted to spawn something that is in multiple relationships (scandalous) there's no way to express this with the new spawning api.
let character = commands.spawn(RandomCharacter).id();
commands.spawn(Organization).add_one_related::<InOrg>(character);
commands.spawn(Town).add_one_related::<InTown>(character);
What solution would you like?
A new method on RelationshipTarget that takes an entity(s) instead of a bundle.
let character = commands.spawn(RandomCharacter).id();
commands.spawn((
Town,
// Not sold on the name, I'm sure there's something better I could come up with but brain is hardly braining.
Residents::from_entity(character),
))
commands.spawn((
Organization,
OrganizationMembers::from_entity(entity)
));
And possibly some way of doing it with the macros, though I'm not sure how.
What alternative(s) have you considered?
Doing it the way shown above, while it works it doesn't allow me to take advantage of the new relationship spawning api which is a shame.