Immutable relationships
- Dominant language
- Rust
- Stars
- 48.2k
- Forks
- 4.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 171
Description
## What problem does this solve or what need does it fill?
Currently when trying to implement relationships on immutable components bevy will complain that the components need to be mutable
## What solution would you like?
It'd be nice to have a way to implement relationships on immutable components, especially for one to one relationships.
I don't know if this is possible or not, someone who knows more about relationships will probably have to check.
```rust
#[derive(Component)]
#[component(immutable)]
#[relationship_target(relationship = RelationshipThingy)]
pub struct ThingyRelationship(Entity);
#[derive(Component)]
#[component(immutable)]
#[relationship(relationship_target = ThingyRelationship)]
pub struct RelationshipThingy(Entity);
```
## What alternative(s) have you considered?
The current solution of not doing this, however this does mean that relationships miss out on a lot of the benefits of immutable components.
Contributor guide
Research direction
The issue names no files, tests, or entry points. Start by reproducing the shown immutable relationship declarations and tracing the relationship and immutable-component validation; done would mean relationships can be declared on immutable components, especially the one-to-one case, with coverage for the supported behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- game-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 32/100