From 223a54629c680d97e642a29c606dd7ef26740367 Mon Sep 17 00:00:00 2001 From: Periwink Date: Mon, 3 Jun 2024 09:19:00 -0400 Subject: [PATCH] Add Hash for Tick (#13525) # Objective - There are some situations (networking) where storing `Tick` as a key in a hashmap is useful --- crates/bevy_ecs/src/component.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/crates/bevy_ecs/src/component.rs b/crates/bevy_ecs/src/component.rs index 2e629aa5a2..03dfae047e 100644 --- a/crates/bevy_ecs/src/component.rs +++ b/crates/bevy_ecs/src/component.rs @@ -906,8 +906,12 @@ impl<'w> ComponentInitializer<'w> { /// This is used to power change detection. /// /// *Note* that a system that hasn't been run yet has a `Tick` of 0. -#[derive(Copy, Clone, Default, Debug, Eq, PartialEq)] -#[cfg_attr(feature = "bevy_reflect", derive(Reflect), reflect(Debug, PartialEq))] +#[derive(Copy, Clone, Default, Debug, Eq, Hash, PartialEq)] +#[cfg_attr( + feature = "bevy_reflect", + derive(Reflect), + reflect(Debug, Hash, PartialEq) +)] pub struct Tick { tick: u32, }