Add Hash for Tick (#13525)

# Objective

- There are some situations (networking) where storing `Tick` as a key
in a hashmap is useful
This commit is contained in:
Periwink 2024-06-03 09:19:00 -04:00 committed by GitHub
parent d26900a9ea
commit 223a54629c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -906,8 +906,12 @@ impl<'w> ComponentInitializer<'w> {
/// This is used to power change detection. /// This is used to power change detection.
/// ///
/// *Note* that a system that hasn't been run yet has a `Tick` of 0. /// *Note* that a system that hasn't been run yet has a `Tick` of 0.
#[derive(Copy, Clone, Default, Debug, Eq, PartialEq)] #[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialEq)]
#[cfg_attr(feature = "bevy_reflect", derive(Reflect), reflect(Debug, PartialEq))] #[cfg_attr(
feature = "bevy_reflect",
derive(Reflect),
reflect(Debug, Hash, PartialEq)
)]
pub struct Tick { pub struct Tick {
tick: u32, tick: u32,
} }