bevy/crates/bevy_ecs/src
Freyja-moth 772524b3a6 Change with_related to work with a Bundle and added with_relationships method (#18699)
# Objective

Fixes #18678

## Solution

Moved the current `with_related` method to `with_relationships` and
added a new `with_related` that uses a bundle.

I'm not entirely sold on the name just yet, if anyone has any ideas let
me know.

## Testing

I wasn't able to test these changes because it crashed my computer every
time I tried (fun). But there don't seem to be any tests that use the
old `with_related` method so it should be fine, hopefully

## Showcase

```rust
commands.spawn_empty()
    .with_related::<Relationship>(Name::new("Related thingy"))
    .with_relationships(|rel| {
        rel.spawn(Name::new("Second related thingy"));
    });
```

---------

Co-authored-by: Carter Anderson <mcanders1@gmail.com>
2025-04-10 01:19:33 +02:00
..
entity Add #[deprecated(since = "0.16.0", ...)] to items missing it (#18702) 2025-04-03 21:46:46 +02:00
error Use Display instead of Debug in the default error handler (#18629) 2025-03-31 22:33:28 +02:00
event Improve error message for missing events (#18683) 2025-04-03 21:45:43 +02:00
identifier
observer Change with_related to work with a Bundle and added with_relationships method (#18699) 2025-04-10 01:19:33 +02:00
query use entity set collections type aliases instead of defaults (#18695) 2025-04-03 21:45:44 +02:00
reflect
relationship Change with_related to work with a Bundle and added with_relationships method (#18699) 2025-04-10 01:19:33 +02:00
schedule Get names of queued components (#18451) 2025-04-03 21:45:42 +02:00
storage
system clarified docs for bundle removal commands (#18754) 2025-04-09 00:21:41 +02:00
world Add #[deprecated(since = "0.16.0", ...)] to items missing it (#18702) 2025-04-03 21:46:46 +02:00
archetype.rs Fix clippy::let_and_return in bevy_ecs (#18481) 2025-03-24 00:09:30 +01:00
batching.rs
bundle.rs Fix clippy::let_and_return in bevy_ecs (#18481) 2025-03-24 00:09:30 +01:00
change_detection.rs Expose the added tick for change detection, both getting and setting. (#18746) 2025-04-09 00:21:42 +02:00
component.rs Get names of queued components (#18451) 2025-04-03 21:45:42 +02:00
entity_disabling.rs
hierarchy.rs Change with_related to work with a Bundle and added with_relationships method (#18699) 2025-04-10 01:19:33 +02:00
intern.rs
label.rs
lib.rs Rename EntityBorrow/TrustedEntityBorrow to ContainsEntity/EntityEquivalent (#18470) 2025-03-30 10:24:00 +02:00
name.rs
removal_detection.rs
resource.rs
spawn.rs Change with_related to work with a Bundle and added with_relationships method (#18699) 2025-04-10 01:19:33 +02:00
traversal.rs