Skip to content

Commit 36f2542

Browse files
authored
feat: Reflection implementations on Identifier (#13648)
# Objective - Follow-up on some changes in #11498 - Unblock using `Identifier` to replace `ComponentId` internals. ## Solution - Implement the same `Reflect` impls from `Entity` onto `Identifier` as they share same/similar purposes, ## Testing - No compile errors. Currently `Identifier` has no serialization impls, so there's no need to test a serialization/deserialization roundtrip to ensure correctness. --- ## Changelog ### Added - Reflection implementations on `Identifier`.
1 parent e6a0f75 commit 36f2542

File tree

1 file changed

+5
-0
lines changed
  • crates/bevy_ecs/src/identifier

1 file changed

+5
-0
lines changed

crates/bevy_ecs/src/identifier/mod.rs

+5
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
//! or other IDs that can be packed and expressed within a `u64` sized type.
44
//! [`Identifier`]s cannot be created directly, only able to be converted from other
55
//! compatible IDs.
6+
#[cfg(feature = "bevy_reflect")]
7+
use bevy_reflect::Reflect;
8+
69
use self::{error::IdentifierError, kinds::IdKind, masks::IdentifierMask};
710
use std::{hash::Hash, num::NonZeroU32};
811

@@ -15,6 +18,8 @@ pub(crate) mod masks;
1518
/// segment, a 31-bit high segment, and the significant bit reserved as type flags to denote
1619
/// entity kinds.
1720
#[derive(Debug, Clone, Copy)]
21+
#[cfg_attr(feature = "bevy_reflect", derive(Reflect))]
22+
#[cfg_attr(feature = "bevy_reflect", reflect_value(Debug, Hash, PartialEq))]
1823
// Alignment repr necessary to allow LLVM to better output
1924
// optimised codegen for `to_bits`, `PartialEq` and `Ord`.
2025
#[repr(C, align(8))]

0 commit comments

Comments
 (0)