Skip to content

Commit

Permalink
fix remaining usages
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsDoot committed Sep 4, 2024
1 parent c543aca commit 72c1444
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 12 deletions.
9 changes: 5 additions & 4 deletions crates/bevy_ecs/src/observer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@ mod trigger_event;
pub use runner::*;
pub use trigger_event::*;

use crate::entity::EntityHashMap;
use crate::observer::entity_observer::ObservedBy;
use crate::{archetype::ArchetypeFlags, system::IntoObserverSystem, world::*};
use crate::{component::ComponentId, prelude::*, world::DeferredWorld};
use bevy_ptr::Ptr;
use bevy_utils::{EntityHashMap, HashMap};
use bevy_utils::HashMap;
use std::{fmt::Debug, marker::PhantomData};

/// Type containing triggered [`Event`] information for a given run of an [`Observer`]. This contains the
Expand Down Expand Up @@ -152,15 +153,15 @@ pub struct ObserverTrigger {
}

// Map between an observer entity and its runner
type ObserverMap = EntityHashMap<Entity, ObserverRunner>;
type ObserverMap = EntityHashMap<ObserverRunner>;

/// Collection of [`ObserverRunner`] for [`Observer`] registered to a particular trigger targeted at a specific component.
#[derive(Default, Debug)]
pub struct CachedComponentObservers {
// Observers listening to triggers targeting this component
map: ObserverMap,
// Observers listening to triggers targeting this component on a specific entity
entity_map: EntityHashMap<Entity, ObserverMap>,
entity_map: EntityHashMap<ObserverMap>,
}

/// Collection of [`ObserverRunner`] for [`Observer`] registered to a particular trigger.
Expand All @@ -171,7 +172,7 @@ pub struct CachedObservers {
// Observers listening for this trigger fired at a specific component
component_observers: HashMap<ComponentId, CachedComponentObservers>,
// Observers listening for this trigger fired at a specific entity
entity_observers: EntityHashMap<Entity, ObserverMap>,
entity_observers: EntityHashMap<ObserverMap>,
}

/// Metadata for observers. Stores a cache mapping trigger ids to the registered observers.
Expand Down
1 change: 0 additions & 1 deletion crates/bevy_reflect/src/impls/std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1029,7 +1029,6 @@ macro_rules! impl_reflect_for_hashset {
}

impl_type_path!(::bevy_utils::NoOpHash);
impl_type_path!(::bevy_ecs::entity::EntityHash);
impl_type_path!(::bevy_utils::FixedState);

impl_reflect_for_hashset!(::std::collections::HashSet<V,S>);
Expand Down
10 changes: 5 additions & 5 deletions crates/bevy_render/src/view/visibility/range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ use std::{
use bevy_app::{App, Plugin, PostUpdate};
use bevy_ecs::{
component::Component,
entity::Entity,
entity::{Entity, EntityHashMap},
query::{Changed, With},
schedule::IntoSystemConfigs as _,
system::{Query, Res, ResMut, Resource},
};
use bevy_math::{vec4, FloatOrd, Vec4};
use bevy_reflect::Reflect;
use bevy_transform::components::GlobalTransform;
use bevy_utils::{prelude::default, EntityHashMap, HashMap};
use bevy_utils::{prelude::default, HashMap};
use nonmax::NonMaxU16;
use wgpu::{BufferBindingType, BufferUsages};

Expand Down Expand Up @@ -191,7 +191,7 @@ impl VisibilityRange {
#[derive(Resource)]
pub struct RenderVisibilityRanges {
/// Information corresponding to each entity.
entities: EntityHashMap<Entity, RenderVisibilityEntityInfo>,
entities: EntityHashMap<RenderVisibilityEntityInfo>,

/// Maps a [`VisibilityRange`] to its index within the `buffer`.
///
Expand Down Expand Up @@ -309,13 +309,13 @@ impl RenderVisibilityRanges {
#[derive(Resource, Default)]
pub struct VisibleEntityRanges {
/// Stores which bit index each view corresponds to.
views: EntityHashMap<Entity, u8>,
views: EntityHashMap<u8>,

/// Stores a bitmask in which each view has a single bit.
///
/// A 0 bit for a view corresponds to "out of range"; a 1 bit corresponds to
/// "in range".
entities: EntityHashMap<Entity, u32>,
entities: EntityHashMap<u32>,
}

impl VisibleEntityRanges {
Expand Down
4 changes: 2 additions & 2 deletions examples/2d/mesh2d_manual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use bevy::{
color::palettes::basic::YELLOW,
core_pipeline::core_2d::{Transparent2d, CORE_2D_DEPTH_FORMAT},
ecs::entity::EntityHashMap,
math::FloatOrd,
prelude::*,
render::{
Expand All @@ -33,7 +34,6 @@ use bevy::{
Mesh2dPipelineKey, Mesh2dTransforms, MeshFlags, RenderMesh2dInstance, SetMesh2dBindGroup,
SetMesh2dViewBindGroup, WithMesh2d,
},
utils::EntityHashMap,
};
use std::f32::consts::PI;

Expand Down Expand Up @@ -291,7 +291,7 @@ pub const COLORED_MESH2D_SHADER_HANDLE: Handle<Shader> =

/// Our custom pipeline needs its own instance storage
#[derive(Resource, Deref, DerefMut, Default)]
pub struct RenderColoredMesh2dInstances(EntityHashMap<Entity, RenderMesh2dInstance>);
pub struct RenderColoredMesh2dInstances(EntityHashMap<RenderMesh2dInstance>);

impl Plugin for ColoredMesh2dPlugin {
fn build(&self, app: &mut App) {
Expand Down

0 comments on commit 72c1444

Please sign in to comment.