Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions steel-registry/src/entity_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ pub enum MobCategory {

/// Entity dimensions used for bounding box calculation.
/// Bounding box is centered on X/Z with Y at entity feet.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct EntityDimensions {
pub width: f32,
pub height: f32,
Expand Down Expand Up @@ -52,7 +52,7 @@ impl EntityDimensions {
}

/// Behavioral flags for entity collision and interaction.
#[derive(Debug, Clone, Copy)]
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct EntityFlags {
pub is_pushable: bool,
pub is_attackable: bool,
Expand Down Expand Up @@ -95,6 +95,13 @@ pub struct EntityType {

pub type EntityTypeRef = &'static EntityType;

impl PartialEq for EntityTypeRef {
#[expect(clippy::disallowed_methods)] // This IS the PartialEq impl; ptr::eq is correct here
fn eq(&self, other: &Self) -> bool {
std::ptr::eq(*self, *other)
}
}

pub struct EntityTypeRegistry {
types_by_id: Vec<EntityTypeRef>,
types_by_key: FxHashMap<Identifier, usize>,
Expand Down
Loading