Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Merged by Bors] - Add more FromWorld implementations #3945

Closed

Conversation

TheRawMeatball
Copy link
Member

Objective

Make FromWorld more useful for abstractions with a form similar to

trait FancyAbstraction {
  type PreInitializedData: FromWorld;
}

Solution

Add a FromWorld implementation for SystemState as well as a way to group together multiple FromWorld implementing types as one.

Note: I plan to follow up this PR with another to add Local support to exclusive systems, which should get a fair amount of use from the FromWorld implementation on SystemState.

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Feb 14, 2022
@TheRawMeatball TheRawMeatball added A-ECS Entities, components, systems, and events C-Enhancement A new feature and removed S-Needs-Triage This issue needs to be labelled labels Feb 14, 2022
Copy link
Member

@alice-i-cecile alice-i-cecile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very interesting. This PR's code quality and docs are fine. The future work sounds promising and this LGTM, but I wouldn't merge until we have something useful built on top of this (just fork off of this PR IMO).

Copy link
Member

@cart cart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a win! Love the idea. Maybe we should do the same for QueryState?

crates/bevy_ecs/src/world/mod.rs Outdated Show resolved Hide resolved
@alice-i-cecile
Copy link
Member

This is a win! Love the idea. Maybe we should do the same for QueryState?

I like this, I think.

@cart
Copy link
Member

cart commented Apr 5, 2022

bors r+

bors bot pushed a commit that referenced this pull request Apr 5, 2022
# Objective

Make `FromWorld` more useful for abstractions with a form similar to
```rs
trait FancyAbstraction {
  type PreInitializedData: FromWorld;
}
```

## Solution

Add a `FromWorld` implementation for `SystemState` as well as a way to group together multiple `FromWorld` implementing types as one.

Note: I plan to follow up this PR with another to add `Local` support to exclusive systems, which should get a fair amount of use from the `FromWorld` implementation on `SystemState`.
@bors bors bot changed the title Add more FromWorld implementations [Merged by Bors] - Add more FromWorld implementations Apr 5, 2022
@bors bors bot closed this Apr 5, 2022
aevyrie pushed a commit to aevyrie/bevy that referenced this pull request Jun 7, 2022
# Objective

Make `FromWorld` more useful for abstractions with a form similar to
```rs
trait FancyAbstraction {
  type PreInitializedData: FromWorld;
}
```

## Solution

Add a `FromWorld` implementation for `SystemState` as well as a way to group together multiple `FromWorld` implementing types as one.

Note: I plan to follow up this PR with another to add `Local` support to exclusive systems, which should get a fair amount of use from the `FromWorld` implementation on `SystemState`.
ItsDoot pushed a commit to ItsDoot/bevy that referenced this pull request Feb 1, 2023
# Objective

Make `FromWorld` more useful for abstractions with a form similar to
```rs
trait FancyAbstraction {
  type PreInitializedData: FromWorld;
}
```

## Solution

Add a `FromWorld` implementation for `SystemState` as well as a way to group together multiple `FromWorld` implementing types as one.

Note: I plan to follow up this PR with another to add `Local` support to exclusive systems, which should get a fair amount of use from the `FromWorld` implementation on `SystemState`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ECS Entities, components, systems, and events C-Enhancement A new feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants