-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
Open
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile timesC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!
Description
> Is there a way we can make `SystemStare::get_manual` take an immutable reference to self? Similar to `QueryState::get_manual`.
At first glance, this seems very difficult to generalize. We'd have to change SystemParam::get_param to take an immutable refence to the state, which would break params that need to modify their state such as Commands or Local or EventReader.
One way of doing this would be to add a new trait for SystemParams that do not mutably access their state in get_param, and then add SystemState::get_readonly which is constrained to using this trait. This would allow most SystemParams to be used with a read-only SystemState, while excluding the param types that don't make sense. I am not exactly sure what this would look like, though.
Originally posted by @JoJoJet in #7084 (comment)
kurtkuehnertkurtkuehnert
Metadata
Metadata
Assignees
Labels
A-ECSEntities, components, systems, and eventsEntities, components, systems, and eventsC-PerformanceA change motivated by improving speed, memory usage or compile timesA change motivated by improving speed, memory usage or compile timesC-UsabilityA targeted quality-of-life change that makes Bevy easier to useA targeted quality-of-life change that makes Bevy easier to useD-ComplexQuite challenging from either a design or technical perspective. Ask for help!Quite challenging from either a design or technical perspective. Ask for help!