-
-
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
[Merged by Bors] - Added the ability to get or set the last change tick of a system. #5838
Changes from all commits
0d385d5
fd4132f
06a73ed
e187d70
e7eb188
2d88809
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,6 +106,15 @@ impl<SystemA: System, SystemB: System<In = SystemA::Out>> System for ChainSystem | |
self.system_a.check_change_tick(change_tick); | ||
self.system_b.check_change_tick(change_tick); | ||
} | ||
|
||
fn get_last_change_tick(&self) -> u32 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would argue that if we can't implement these functions for every System, they aren't System functions. |
||
self.system_a.get_last_change_tick() | ||
} | ||
|
||
fn set_last_change_tick(&mut self, last_change_tick: u32) { | ||
self.system_a.set_last_change_tick(last_change_tick); | ||
self.system_b.set_last_change_tick(last_change_tick); | ||
} | ||
} | ||
|
||
/// An extension trait providing the [`IntoChainSystem::chain`] method for convenient [`System`] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -224,6 +224,14 @@ impl System for FixedTimestep { | |
fn check_change_tick(&mut self, change_tick: u32) { | ||
self.internal_system.check_change_tick(change_tick); | ||
} | ||
|
||
fn get_last_change_tick(&self) -> u32 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here. Why can't we just pipe through the internal system's last_change_tick? |
||
self.internal_system.get_last_change_tick() | ||
} | ||
|
||
fn set_last_change_tick(&mut self, last_change_tick: u32) { | ||
self.internal_system.set_last_change_tick(last_change_tick); | ||
} | ||
} | ||
|
||
#[cfg(test)] | ||
|
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.
As mentioned in #5633, I think this deserves some level of warning around the effects this will have on change detection / that setting it manually could break things if you aren't careful.