-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Local
with required config as a type parameter
#2491
Conversation
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
/// system.initialize(world); | ||
/// system.run((), world); | ||
/// ``` | ||
pub struct Local<'a, T: Resource, ValueFrom: local_value::LocalValue = local_value::Default> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe SystemConfig
would fit better?
As of #3633, this no longer makes sense. |
# 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
Objective
Local
with required config as a const generic parameter #2463 and AddRequired
system param #2440Local
with required config as a const generic parameter #2463 (comment), using unit structsSolution
Local
:Default
,FromWorld
andNeedConfig
Default
configuration. This is a breaking change but it's what is making the most senseLocal
is initialised byDefault
, nothing changelocal_value::FromWorld
orlocal_value::NeedConfig