Local with required config as a type parameter#2491
Closed
mockersf wants to merge 4 commits intobevyengine:mainfrom
Closed
Local with required config as a type parameter#2491mockersf wants to merge 4 commits intobevyengine:mainfrom
Local with required config as a type parameter#2491mockersf wants to merge 4 commits intobevyengine:mainfrom
Conversation
Member
Definitely agree with this choice. I would expect the large majority of current uses to be using |
2f954dc to
43846c0
Compare
43846c0 to
fc69097
Compare
fc69097 to
30afa57
Compare
58ebe6b to
af55850
Compare
NiklasEi
reviewed
Oct 29, 2021
| /// system.initialize(world); | ||
| /// system.run((), world); | ||
| /// ``` | ||
| pub struct Local<'a, T: Resource, ValueFrom: local_value::LocalValue = local_value::Default> { |
Member
There was a problem hiding this comment.
How about ValueFrom -> InitializeWith?
|
|
||
| /// [`Local`](crate::system::Local) should be initialized by calling | ||
| /// [`FunctionSystem::config()`](crate::system::FunctionSystem::config) on the system. | ||
| pub struct NeedConfig; |
Member
There was a problem hiding this comment.
Maybe SystemConfig would fit better?
Member
|
As of #3633, this no longer makes sense. |
kurtkuehnert
pushed a commit
to kurtkuehnert/bevy
that referenced
this pull request
Mar 6, 2022
# Objective - Fix the ugliness of the `config` api. - Supercedes bevyengine#2440, bevyengine#2463, bevyengine#2491 ## Solution - Since bevyengine#2398, capturing closure systems have worked. - Use those instead where we needed config before - Remove the rest of the config api. - Related: bevyengine#2777
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Objective
Localwith required config as a const generic parameter #2463 and AddRequiredsystem param #2440Localwith required config as a const generic parameter #2463 (comment), using unit structsSolution
Local:Default,FromWorldandNeedConfigDefaultconfiguration. This is a breaking change but it's what is making the most senseLocalis initialised byDefault, nothing changelocal_value::FromWorldorlocal_value::NeedConfig