# Objective After #17398, Bevy now has relations! We don't teach users how to make / work with these in the examples yet though, but we definitely should. ## Solution - Add a simple abstract example that goes over defining, spawning, traversing and removing a custom relations. - ~~Add `Relationship` and `RelationshipTarget` to the prelude: the trait methods are really helpful here.~~ - this causes subtle ambiguities with method names and weird compiler errors. Not doing it here! - Clean up related documentation that I referenced when writing this example. ## Testing `cargo run --example relationships` ## Notes to reviewers 1. Yes, I know that the cycle detection code could be more efficient. I decided to reduce the caching to avoid distracting from the broader point of "here's how you traverse relationships". 2. Instead of using an `App`, I've decide to use `World::run_system_once` + system functions defined inside of `main` to do something closer to literate programming. --------- Co-authored-by: Joona Aalto <jondolf.dev@gmail.com> Co-authored-by: MinerSebas <66798382+MinerSebas@users.noreply.github.com> Co-authored-by: Kristoffer Søholm <k.soeholm@gmail.com> |
||
|---|---|---|
| .. | ||
| change_detection.rs | ||
| component_hooks.rs | ||
| custom_query_param.rs | ||
| custom_schedule.rs | ||
| dynamic.rs | ||
| ecs_guide.rs | ||
| event.rs | ||
| fallible_params.rs | ||
| fallible_systems.rs | ||
| fixed_timestep.rs | ||
| generic_system.rs | ||
| hierarchy.rs | ||
| immutable_components.rs | ||
| iter_combinations.rs | ||
| nondeterministic_system_order.rs | ||
| observer_propagation.rs | ||
| observers.rs | ||
| one_shot_systems.rs | ||
| parallel_query.rs | ||
| relationships.rs | ||
| removal_detection.rs | ||
| run_conditions.rs | ||
| send_and_receive_events.rs | ||
| startup_system.rs | ||
| system_closure.rs | ||
| system_param.rs | ||
| system_piping.rs | ||
| system_stepping.rs | ||