-
-
Notifications
You must be signed in to change notification settings - Fork 3.9k
Expose the added tick for change detection, both getting and setting. #18746
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
alice-i-cecile
merged 5 commits into
bevyengine:main
from
moonheart08:2025-07-04-change-detection-added-helpers
Apr 8, 2025
Merged
Expose the added tick for change detection, both getting and setting. #18746
alice-i-cecile
merged 5 commits into
bevyengine:main
from
moonheart08:2025-07-04-change-detection-added-helpers
Apr 8, 2025
Conversation
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
SpecificProtagonist
suggested changes
Apr 7, 2025
SpecificProtagonist
approved these changes
Apr 7, 2025
chescock
approved these changes
Apr 7, 2025
d7f221e
to
2e1e65c
Compare
Should be good to go now. |
Co-authored-by: SpecificProtagonist <vincentjunge@posteo.net>
Co-authored-by: Chris Russell <8494645+chescock@users.noreply.github.com>
2e1e65c
to
5afe74b
Compare
alice-i-cecile
approved these changes
Apr 8, 2025
mockersf
pushed a commit
that referenced
this pull request
Apr 8, 2025
…#18746) # Objective - Allow viewing and setting the added tick for change detection aware data, to allow operations like checking if the value has been modified since first being added, and spoofing that state (i.e. returning the value to default in place without a remove/insert dance) ## Solution - Added corresponding functions matching the existing `changed` API: - `fn added(&self) -> Tick` - `fn set_added(&mut self)` - `fn set_last_added(&mut self, last_added: Tick)` Discussed on discord @ https://canary.discord.com/channels/691052431525675048/749335865876021248/1358718892465193060 ## Testing - Running the bevy test suite by.. making a PR, heck. - No new tests were introduced due to triviality (i.e. I don't know what to test about this API, and the corresponding API for `changed` is similarly lacking tests.) --------- Co-authored-by: moonheart08 <moonheart08@users.noreply.github.com> Co-authored-by: SpecificProtagonist <vincentjunge@posteo.net> Co-authored-by: Chris Russell <8494645+chescock@users.noreply.github.com>
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-Feature
A new feature, making something new possible
D-Trivial
Nice and easy! A great choice to get started with Bevy
S-Ready-For-Final-Review
This PR has been approved by the community. It's ready for a maintainer to consider merging it
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
Solution
changed
API:fn added(&self) -> Tick
fn set_added(&mut self)
fn set_last_added(&mut self, last_added: Tick)
Discussed on discord @ https://canary.discord.com/channels/691052431525675048/749335865876021248/1358718892465193060
Testing
changed
is similarly lacking tests.)