bevyengine / bevyengine/bevy

Add a lax version of `RelationshipTarget` as a super trait.

Open
#18,274 3 comments 0 reactions 0 assignees View on GitHub
A-ECS C-Feature D-Straightforward S-Needs-Design X-Contentious
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

## What problem does this solve or what need does it fill?

An abstraction of "references multiple other entities" is very commonly needed, having it in bevy is nice. `RelationshipTarget` is overly specific and does not fit every use case.

## What solution would you like?

Add a super trait to `RelationshipTarget` called `EntityReferences`.

```rust
pub trait EntityReferences {
fn get_entities(&self) -> impl IntoIterator;
}
```

This works with most use cases from `Vec` to `Option`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.