Skip to content

Make timestep mutable#2637

Closed
hanabi1224 wants to merge 1 commit intobevyengine:mainfrom
hanabi1224:mutable-timestep
Closed

Make timestep mutable#2637
hanabi1224 wants to merge 1 commit intobevyengine:mainfrom
hanabi1224:mutable-timestep

Conversation

@hanabi1224
Copy link

@hanabi1224 hanabi1224 commented Aug 11, 2021

Objective

Solution

  • Move timestep state to behind a smart pointer

@github-actions github-actions bot added the S-Needs-Triage This issue needs to be labelled label Aug 11, 2021
@DJMcNab
Copy link
Member

DJMcNab commented Aug 11, 2021

I this is a fine change by itself, but it feels like there should be a solution which is more integrated into the ECS itself, somehow

Like these locks should not be needed, and instead the mutability 'locking' could be managed by the scheduler.


pub fn with_label(mut self, label: &str) -> Self {
self.state.label = Some(label.to_string());
pub fn with_label(mut self, label: impl Into<String>) -> Self {
Copy link
Author

@hanabi1224 hanabi1224 Aug 11, 2021

Choose a reason for hiding this comment

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

this impl Into<String> change is irrelevant, it saves an extra string clone when label String is created on the fly and user just want to hand over ownership, which is not allowed with a &str parameter

@hanabi1224 hanabi1224 changed the title [Draft ]Make timestep mutable Make timestep mutable Aug 12, 2021
@alice-i-cecile alice-i-cecile added A-Core C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Design This issue requires design work to think about how it would best be accomplished and removed S-Needs-Triage This issue needs to be labelled labels Aug 16, 2021
@alice-i-cecile
Copy link
Member

@maniwani, what do you want to do with this one?

@alice-i-cecile alice-i-cecile added X-Needs-SME This type of work requires an SME to approve it. S-Needs-Design This issue requires design work to think about how it would best be accomplished and removed S-Needs-Design This issue requires design work to think about how it would best be accomplished labels May 3, 2022
@alice-i-cecile
Copy link
Member

I think we can tackle this issue in #5752 instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-Usability A targeted quality-of-life change that makes Bevy easier to use S-Needs-Design This issue requires design work to think about how it would best be accomplished X-Needs-SME This type of work requires an SME to approve it.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants