Skip to content

Commit bd14a7f

Browse files
Add getter for SystemMeta::last_run field. (#22516)
# Objective Add `SytemMeta::get_last_run`. Full description in issue: #22487 ## Solution I added the getter. Since `Tick` is `Copy`, I just returned it by value. Pretty simple. ## Testing implemented for: https://github.com/stinkytoe/shieldtank/blob/04d216a8db91749c9975c2756dc1a987e80b8aea/src/query/by_iid.rs#L117 example usages: - https://github.com/stinkytoe/axe_man_adventure/blob/77f070add41f99cef92f9db9e5e6269339476911/src/main.rs#L426 - https://github.com/stinkytoe/dungeon_of_madness/blob/3ec5db4fe7b0b942e3dcd2037814a8717506bbc3/src/main.rs#L200 Co-authored-by: Alice Cecile <[email protected]>
1 parent d58d57e commit bd14a7f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

crates/bevy_ecs/src/system/function_system.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ impl SystemMeta {
110110
pub fn set_exclusive(&mut self) {
111111
self.flags |= SystemStateFlags::EXCLUSIVE;
112112
}
113+
114+
/// Expose a read only copy of `last_run`.
115+
pub fn get_last_run(&self) -> Tick {
116+
self.last_run
117+
}
113118
}
114119

115120
// TODO: Actually use this in FunctionSystem. We should probably only do this once Systems are constructed using a World reference

0 commit comments

Comments
 (0)