Skip to content

Commit

Permalink
assoc fn
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxyUwU committed Aug 4, 2022
1 parent 07d5769 commit 2fafcd9
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions crates/bevy_ecs/src/system/system_param.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,17 @@ where
}

impl<'w, T: Resource> Res<'w, T> {
// no it shouldn't clippy
#[allow(clippy::should_implement_trait)]
pub fn clone(this: &Self) -> Self {
Self {
value: this.value,
ticks: this.ticks,
last_change_tick: this.last_change_tick,
change_tick: this.change_tick,
}
}

/// Returns `true` if the resource was added after the system last ran.
pub fn is_added(&self) -> bool {
self.ticks.is_added(self.last_change_tick, self.change_tick)
Expand Down

0 comments on commit 2fafcd9

Please sign in to comment.