reexport entity set collections in entity module (#18413)

# Objective

Unlike for their helper typers, the import paths for
`unique_array::UniqueEntityArray`, `unique_slice::UniqueEntitySlice`,
`unique_vec::UniqueEntityVec`, `hash_set::EntityHashSet`,
`hash_map::EntityHashMap`, `index_set::EntityIndexSet`,
`index_map::EntityIndexMap` are quite redundant.

When looking at the structure of `hashbrown`, we can also see that while
both `HashSet` and `HashMap` have their own modules, the main types
themselves are re-exported to the crate level.

## Solution

Re-export the types in their shared `entity` parent module, and simplify
the imports where they're used.
This commit is contained in:
Vic 2025-03-30 05:51:14 +02:00 committed by GitHub
parent b0c4467398
commit f57c7a43c4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
42 changed files with 81 additions and 76 deletions

View File

@ -1,4 +1,4 @@
use bevy_ecs::entity::{hash_set::EntityHashSet, Entity};
use bevy_ecs::entity::{Entity, EntityHashSet};
use criterion::{BenchmarkId, Criterion, Throughput};
use rand::{Rng, SeedableRng};
use rand_chacha::ChaCha8Rng;

View File

@ -6,7 +6,7 @@ use bevy_app::Plugin;
use bevy_asset::{load_internal_asset, weak_handle, Handle};
use bevy_derive::Deref;
use bevy_ecs::{
entity::{hash_map::EntityHashMap, hash_set::EntityHashSet},
entity::{EntityHashMap, EntityHashSet},
prelude::*,
};
use bevy_image::BevyDefault as _;

View File

@ -844,7 +844,7 @@ mod tests {
use super::ComponentCloneCtx;
use crate::{
component::{Component, ComponentCloneBehavior, ComponentDescriptor, StorageType},
entity::{hash_map::EntityHashMap, Entity, EntityCloner, SourceComponent},
entity::{Entity, EntityCloner, EntityHashMap, SourceComponent},
prelude::{ChildOf, Children, Resource},
reflect::{AppTypeRegistry, ReflectComponent, ReflectFromWorld},
world::{FromWorld, World},

View File

@ -13,7 +13,7 @@ use core::{
option, result,
};
use super::{unique_slice::UniqueEntitySlice, Entity};
use super::{Entity, UniqueEntitySlice};
use bevy_platform_support::sync::Arc;

View File

@ -108,7 +108,7 @@ impl<A: smallvec::Array<Item = Entity>> MapEntities for SmallVec<A> {
///
/// ```
/// # use bevy_ecs::entity::{Entity, EntityMapper};
/// # use bevy_ecs::entity::hash_map::EntityHashMap;
/// # use bevy_ecs::entity::EntityHashMap;
/// #
/// pub struct SimpleEntityMapper {
/// map: EntityHashMap<Entity>,
@ -281,7 +281,7 @@ impl<'m> SceneEntityMapper<'m> {
#[cfg(test)]
mod tests {
use crate::{
entity::{hash_map::EntityHashMap, Entity, EntityMapper, SceneEntityMapper},
entity::{Entity, EntityHashMap, EntityMapper, SceneEntityMapper},
world::World,
};

View File

@ -54,13 +54,23 @@ pub use hash::*;
pub mod hash_map;
pub mod hash_set;
pub use hash_map::EntityHashMap;
pub use hash_set::EntityHashSet;
pub mod index_map;
pub mod index_set;
pub use index_map::EntityIndexMap;
pub use index_set::EntityIndexSet;
pub mod unique_array;
pub mod unique_slice;
pub mod unique_vec;
pub use unique_array::UniqueEntityArray;
pub use unique_slice::UniqueEntitySlice;
pub use unique_vec::UniqueEntityVec;
use crate::{
archetype::{ArchetypeId, ArchetypeRow},
change_detection::MaybeLocation,

View File

@ -25,10 +25,9 @@ use alloc::{
use bevy_platform_support::sync::Arc;
use super::{
unique_array::UniqueEntityArray,
unique_vec::{self, UniqueEntityVec},
Entity, EntitySet, EntitySetIterator, FromEntitySetIterator, TrustedEntityBorrow,
UniqueEntityIter,
UniqueEntityArray, UniqueEntityIter,
};
/// A slice that contains only unique entities.

View File

@ -20,9 +20,9 @@ use alloc::{
use bevy_platform_support::sync::Arc;
use super::{
unique_array::UniqueEntityArray,
unique_slice::{self, UniqueEntitySlice},
Entity, EntitySet, FromEntitySetIterator, TrustedEntityBorrow, UniqueEntityIter,
Entity, EntitySet, FromEntitySetIterator, TrustedEntityBorrow, UniqueEntityArray,
UniqueEntityIter,
};
/// A `Vec` that contains only unique entities.

View File

@ -11,7 +11,7 @@ use crate::{
archetype::ArchetypeFlags,
change_detection::MaybeLocation,
component::ComponentId,
entity::hash_map::EntityHashMap,
entity::EntityHashMap,
prelude::*,
system::IntoObserverSystem,
world::{DeferredWorld, *},

View File

@ -1,7 +1,7 @@
use crate::{
batching::BatchingStrategy,
component::Tick,
entity::{unique_vec::UniqueEntityVec, EntityBorrow, TrustedEntityBorrow},
entity::{EntityBorrow, TrustedEntityBorrow, UniqueEntityVec},
world::unsafe_world_cell::UnsafeWorldCell,
};
@ -363,7 +363,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter, E: TrustedEntityBorrow + Sync>
///
/// ```
/// use bevy_utils::Parallel;
/// use crate::{bevy_ecs::{prelude::{Component, Res, Resource, Entity}, entity::unique_vec::UniqueEntityVec, system::Query}};
/// use crate::{bevy_ecs::{prelude::{Component, Res, Resource, Entity}, entity::UniqueEntityVec, system::Query}};
/// # use core::slice;
/// # use crate::bevy_ecs::entity::UniqueEntityIter;
/// # fn some_expensive_operation(_item: &T) -> usize {

View File

@ -1,7 +1,7 @@
use crate::{
archetype::{Archetype, ArchetypeComponentId, ArchetypeGeneration, ArchetypeId},
component::{ComponentId, Tick},
entity::{unique_array::UniqueEntityArray, Entity, EntityBorrow, EntitySet},
entity::{Entity, EntityBorrow, EntitySet, UniqueEntityArray},
entity_disabling::DefaultQueryFilters,
prelude::FromWorld,
query::{Access, FilteredAccess, QueryCombinationIter, QueryIter, QueryParIter, WorldQuery},
@ -11,7 +11,7 @@ use crate::{
};
#[cfg(all(not(target_arch = "wasm32"), feature = "multi_threaded"))]
use crate::entity::{unique_slice::UniqueEntitySlice, TrustedEntityBorrow};
use crate::entity::{TrustedEntityBorrow, UniqueEntitySlice};
use alloc::vec::Vec;
use core::{fmt, ptr};
@ -1005,7 +1005,7 @@ impl<D: QueryData, F: QueryFilter> QueryState<D, F> {
/// # Examples
///
/// ```
/// use bevy_ecs::{prelude::*, query::QueryEntityError, entity::{EntitySetIterator, unique_array::UniqueEntityArray, unique_vec::UniqueEntityVec}};
/// use bevy_ecs::{prelude::*, query::QueryEntityError, entity::{EntitySetIterator, UniqueEntityArray, UniqueEntityVec}};
///
/// #[derive(Component, PartialEq, Debug)]
/// struct A(usize);
@ -1100,7 +1100,7 @@ impl<D: QueryData, F: QueryFilter> QueryState<D, F> {
/// returned instead.
///
/// ```
/// use bevy_ecs::{prelude::*, query::QueryEntityError, entity::{EntitySetIterator, unique_array::UniqueEntityArray, unique_vec::UniqueEntityVec}};
/// use bevy_ecs::{prelude::*, query::QueryEntityError, entity::{EntitySetIterator, UniqueEntityArray, UniqueEntityVec}};
///
/// #[derive(Component, PartialEq, Debug)]
/// struct A(usize);

View File

@ -1,9 +1,7 @@
use crate::{
batching::BatchingStrategy,
component::Tick,
entity::{
unique_array::UniqueEntityArray, Entity, EntityBorrow, EntityDoesNotExistError, EntitySet,
},
entity::{Entity, EntityBorrow, EntityDoesNotExistError, EntitySet, UniqueEntityArray},
query::{
DebugCheckedUnwrap, NopWorldQuery, QueryCombinationIter, QueryData, QueryEntityError,
QueryFilter, QueryIter, QueryManyIter, QueryManyUniqueIter, QueryParIter, QueryParManyIter,
@ -1345,7 +1343,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> {
/// # Examples
///
/// ```
/// use bevy_ecs::{prelude::*, query::QueryEntityError, entity::{EntitySetIterator, unique_array::UniqueEntityArray, unique_vec::UniqueEntityVec}};
/// use bevy_ecs::{prelude::*, query::QueryEntityError, entity::{EntitySetIterator, UniqueEntityArray, UniqueEntityVec}};
///
/// #[derive(Component, PartialEq, Debug)]
/// struct A(usize);
@ -1623,7 +1621,7 @@ impl<'w, 's, D: QueryData, F: QueryFilter> Query<'w, 's, D, F> {
/// # Examples
///
/// ```
/// use bevy_ecs::{prelude::*, query::QueryEntityError, entity::{EntitySetIterator, unique_array::UniqueEntityArray, unique_vec::UniqueEntityVec}};
/// use bevy_ecs::{prelude::*, query::QueryEntityError, entity::{EntitySetIterator, UniqueEntityArray, UniqueEntityVec}};
///
/// #[derive(Component, PartialEq, Debug)]
/// struct A(usize);

View File

@ -233,8 +233,8 @@ impl<'w> DeferredWorld<'w> {
/// For examples, see [`DeferredWorld::entity_mut`].
///
/// [`EntityMut`]: crate::world::EntityMut
/// [`&EntityHashSet`]: crate::entity::hash_set::EntityHashSet
/// [`EntityHashMap<EntityMut>`]: crate::entity::hash_map::EntityHashMap
/// [`&EntityHashSet`]: crate::entity::EntityHashSet
/// [`EntityHashMap<EntityMut>`]: crate::entity::EntityHashMap
/// [`Vec<EntityMut>`]: alloc::vec::Vec
#[inline]
pub fn get_entity_mut<F: WorldEntityFetch>(
@ -342,7 +342,7 @@ impl<'w> DeferredWorld<'w> {
/// ## [`&EntityHashSet`]
///
/// ```
/// # use bevy_ecs::{prelude::*, entity::hash_set::EntityHashSet, world::DeferredWorld};
/// # use bevy_ecs::{prelude::*, entity::EntityHashSet, world::DeferredWorld};
/// #[derive(Component)]
/// struct Position {
/// x: f32,
@ -365,8 +365,8 @@ impl<'w> DeferredWorld<'w> {
/// ```
///
/// [`EntityMut`]: crate::world::EntityMut
/// [`&EntityHashSet`]: crate::entity::hash_set::EntityHashSet
/// [`EntityHashMap<EntityMut>`]: crate::entity::hash_map::EntityHashMap
/// [`&EntityHashSet`]: crate::entity::EntityHashSet
/// [`EntityHashMap<EntityMut>`]: crate::entity::EntityHashMap
/// [`Vec<EntityMut>`]: alloc::vec::Vec
#[inline]
pub fn entity_mut<F: WorldEntityFetch>(&mut self, entities: F) -> F::DeferredMut<'_> {

View File

@ -2,7 +2,7 @@ use alloc::vec::Vec;
use core::mem::MaybeUninit;
use crate::{
entity::{hash_map::EntityHashMap, hash_set::EntityHashSet, Entity, EntityDoesNotExistError},
entity::{Entity, EntityDoesNotExistError, EntityHashMap, EntityHashSet},
error::Result,
world::{
error::EntityMutableFetchError, unsafe_world_cell::UnsafeWorldCell, EntityMut, EntityRef,
@ -39,8 +39,8 @@ impl<'w> EntityFetcher<'w> {
/// - Pass an [`Entity`] to receive a single [`EntityRef`].
/// - Pass a slice of [`Entity`]s to receive a [`Vec<EntityRef>`].
/// - Pass an array of [`Entity`]s to receive an equally-sized array of [`EntityRef`]s.
/// - Pass a reference to a [`EntityHashSet`](crate::entity::hash_map::EntityHashMap) to receive an
/// [`EntityHashMap<EntityRef>`](crate::entity::hash_map::EntityHashMap).
/// - Pass a reference to a [`EntityHashSet`](crate::entity::EntityHashMap) to receive an
/// [`EntityHashMap<EntityRef>`](crate::entity::EntityHashMap).
///
/// # Errors
///
@ -71,8 +71,8 @@ impl<'w> EntityFetcher<'w> {
/// such as adding or removing components, or despawning the entity.
/// - Pass a slice of [`Entity`]s to receive a [`Vec<EntityMut>`].
/// - Pass an array of [`Entity`]s to receive an equally-sized array of [`EntityMut`]s.
/// - Pass a reference to a [`EntityHashSet`](crate::entity::hash_map::EntityHashMap) to receive an
/// [`EntityHashMap<EntityMut>`](crate::entity::hash_map::EntityHashMap).
/// - Pass a reference to a [`EntityHashSet`](crate::entity::EntityHashMap) to receive an
/// [`EntityHashMap<EntityMut>`](crate::entity::EntityHashMap).
/// # Errors
///
/// - Returns [`EntityMutableFetchError::EntityDoesNotExist`] if any of the given `entities` do not exist in the world.

View File

@ -689,10 +689,10 @@ impl World {
/// }
/// ```
///
/// ## [`EntityHashSet`](crate::entity::hash_map::EntityHashMap)
/// ## [`EntityHashSet`](crate::entity::EntityHashMap)
///
/// ```
/// # use bevy_ecs::{prelude::*, entity::hash_set::EntityHashSet};
/// # use bevy_ecs::{prelude::*, entity::EntityHashSet};
/// #[derive(Component)]
/// struct Position {
/// x: f32,
@ -710,7 +710,7 @@ impl World {
/// }
/// ```
///
/// [`EntityHashSet`]: crate::entity::hash_set::EntityHashSet
/// [`EntityHashSet`]: crate::entity::EntityHashSet
#[inline]
#[track_caller]
pub fn entity<F: WorldEntityFetch>(&self, entities: F) -> F::Ref<'_> {
@ -741,8 +741,8 @@ impl World {
/// such as adding or removing components, or despawning the entity.
/// - Pass a slice of [`Entity`]s to receive a [`Vec<EntityMut>`].
/// - Pass an array of [`Entity`]s to receive an equally-sized array of [`EntityMut`]s.
/// - Pass a reference to a [`EntityHashSet`](crate::entity::hash_map::EntityHashMap) to receive an
/// [`EntityHashMap<EntityMut>`](crate::entity::hash_map::EntityHashMap).
/// - Pass a reference to a [`EntityHashSet`](crate::entity::EntityHashMap) to receive an
/// [`EntityHashMap<EntityMut>`](crate::entity::EntityHashMap).
///
/// In order to perform structural changes on the returned entity reference,
/// such as adding or removing components, or despawning the entity, only a
@ -823,10 +823,10 @@ impl World {
/// }
/// ```
///
/// ## [`EntityHashSet`](crate::entity::hash_map::EntityHashMap)
/// ## [`EntityHashSet`](crate::entity::EntityHashMap)
///
/// ```
/// # use bevy_ecs::{prelude::*, entity::hash_set::EntityHashSet};
/// # use bevy_ecs::{prelude::*, entity::EntityHashSet};
/// #[derive(Component)]
/// struct Position {
/// x: f32,
@ -846,7 +846,7 @@ impl World {
/// }
/// ```
///
/// [`EntityHashSet`]: crate::entity::hash_set::EntityHashSet
/// [`EntityHashSet`]: crate::entity::EntityHashSet
#[inline]
#[track_caller]
pub fn entity_mut<F: WorldEntityFetch>(&mut self, entities: F) -> F::Mut<'_> {
@ -893,8 +893,8 @@ impl World {
/// - Pass an [`Entity`] to receive a single [`EntityRef`].
/// - Pass a slice of [`Entity`]s to receive a [`Vec<EntityRef>`].
/// - Pass an array of [`Entity`]s to receive an equally-sized array of [`EntityRef`]s.
/// - Pass a reference to a [`EntityHashSet`](crate::entity::hash_map::EntityHashMap) to receive an
/// [`EntityHashMap<EntityRef>`](crate::entity::hash_map::EntityHashMap).
/// - Pass a reference to a [`EntityHashSet`](crate::entity::EntityHashMap) to receive an
/// [`EntityHashMap<EntityRef>`](crate::entity::EntityHashMap).
///
/// # Errors
///
@ -905,7 +905,7 @@ impl World {
///
/// For examples, see [`World::entity`].
///
/// [`EntityHashSet`]: crate::entity::hash_set::EntityHashSet
/// [`EntityHashSet`]: crate::entity::EntityHashSet
#[inline]
pub fn get_entity<F: WorldEntityFetch>(
&self,
@ -927,8 +927,8 @@ impl World {
/// such as adding or removing components, or despawning the entity.
/// - Pass a slice of [`Entity`]s to receive a [`Vec<EntityMut>`].
/// - Pass an array of [`Entity`]s to receive an equally-sized array of [`EntityMut`]s.
/// - Pass a reference to a [`EntityHashSet`](crate::entity::hash_map::EntityHashMap) to receive an
/// [`EntityHashMap<EntityMut>`](crate::entity::hash_map::EntityHashMap).
/// - Pass a reference to a [`EntityHashSet`](crate::entity::EntityHashMap) to receive an
/// [`EntityHashMap<EntityMut>`](crate::entity::EntityHashMap).
///
/// In order to perform structural changes on the returned entity reference,
/// such as adding or removing components, or despawning the entity, only a
@ -946,7 +946,7 @@ impl World {
///
/// For examples, see [`World::entity_mut`].
///
/// [`EntityHashSet`]: crate::entity::hash_set::EntityHashSet
/// [`EntityHashSet`]: crate::entity::EntityHashSet
#[inline]
pub fn get_entity_mut<F: WorldEntityFetch>(
&mut self,
@ -3763,7 +3763,7 @@ mod tests {
use crate::{
change_detection::{DetectChangesMut, MaybeLocation},
component::{ComponentCloneBehavior, ComponentDescriptor, ComponentInfo, StorageType},
entity::hash_set::EntityHashSet,
entity::EntityHashSet,
entity_disabling::{DefaultQueryFilters, Disabled},
ptr::OwningPtr,
resource::Resource,

View File

@ -21,7 +21,7 @@ use bevy_utils::synccell::SyncCell;
use core::cell::RefCell;
use bevy_app::{App, Plugin, PostUpdate, PreStartup, PreUpdate};
use bevy_ecs::entity::hash_map::EntityHashMap;
use bevy_ecs::entity::EntityHashMap;
use bevy_ecs::prelude::*;
use bevy_input::InputSystem;
use bevy_platform_support::collections::HashMap;

0
crates/bevy_gizmos/src/lib.rs Executable file → Normal file
View File

View File

@ -15,7 +15,7 @@ use bevy_asset::{
use bevy_color::{Color, LinearRgba};
use bevy_core_pipeline::prelude::Camera3d;
use bevy_ecs::{
entity::{hash_map::EntityHashMap, Entity},
entity::{Entity, EntityHashMap},
hierarchy::ChildSpawner,
name::Name,
world::World,

View File

@ -17,7 +17,7 @@
use bevy_app::prelude::*;
use bevy_ecs::{
entity::{hash_map::EntityHashMap, hash_set::EntityHashSet},
entity::{EntityHashMap, EntityHashSet},
prelude::*,
system::SystemParam,
};

View File

@ -5,7 +5,7 @@ use core::num::NonZero;
use bevy_core_pipeline::core_3d::Camera3d;
use bevy_ecs::{
component::Component,
entity::{hash_map::EntityHashMap, Entity},
entity::{Entity, EntityHashMap},
query::{With, Without},
reflect::ReflectComponent,
resource::Resource,

View File

@ -1,6 +1,6 @@
use bevy_derive::{Deref, DerefMut};
use bevy_ecs::component::Component;
use bevy_ecs::entity::{hash_map::EntityHashMap, Entity};
use bevy_ecs::entity::{Entity, EntityHashMap};
use bevy_ecs::reflect::ReflectComponent;
use bevy_reflect::{std_traits::ReflectDefault, Reflect};
use bevy_render::sync_world::MainEntity;

View File

@ -21,7 +21,7 @@ use bevy_asset::{load_internal_asset, weak_handle, AssetId, Handle};
use bevy_derive::{Deref, DerefMut};
use bevy_ecs::{
component::Component,
entity::{hash_map::EntityHashMap, Entity},
entity::{Entity, EntityHashMap},
prelude::ReflectComponent,
query::With,
resource::Resource,

View File

@ -1,7 +1,7 @@
use core::ops::DerefMut;
use bevy_ecs::{
entity::{hash_map::EntityHashMap, hash_set::EntityHashSet},
entity::{EntityHashMap, EntityHashSet},
prelude::*,
};
use bevy_math::{ops, Mat4, Vec3A, Vec4};

View File

@ -6,7 +6,7 @@ use crate::{
};
use bevy_asset::{AssetEvent, AssetServer, Assets, UntypedAssetId};
use bevy_ecs::{
entity::{hash_map::EntityHashMap, Entities, Entity},
entity::{Entities, Entity, EntityHashMap},
event::EventReader,
query::Has,
resource::Resource,

View File

@ -8,7 +8,7 @@ use bevy_core_pipeline::{
};
use bevy_ecs::{
component::Component,
entity::{hash_map::EntityHashMap, Entity},
entity::{Entity, EntityHashMap},
query::AnyOf,
resource::Resource,
system::{Commands, Query, Res, ResMut},

View File

@ -8,7 +8,7 @@ use bevy_derive::{Deref, DerefMut};
use bevy_ecs::component::Tick;
use bevy_ecs::system::SystemChangeTick;
use bevy_ecs::{
entity::{hash_map::EntityHashMap, hash_set::EntityHashSet},
entity::{EntityHashMap, EntityHashSet},
prelude::*,
system::lifetimeless::Read,
};

View File

@ -1,6 +1,6 @@
use core::borrow::Borrow;
use bevy_ecs::{component::Component, entity::hash_map::EntityHashMap, reflect::ReflectComponent};
use bevy_ecs::{component::Component, entity::EntityHashMap, reflect::ReflectComponent};
use bevy_math::{Affine3A, Mat3A, Mat4, Vec3, Vec3A, Vec4, Vec4Swizzles};
use bevy_reflect::prelude::*;

View File

@ -4,7 +4,7 @@ mod render_layers;
use core::any::TypeId;
use bevy_ecs::component::HookContext;
use bevy_ecs::entity::hash_set::EntityHashSet;
use bevy_ecs::entity::EntityHashSet;
use bevy_ecs::world::DeferredWorld;
use derive_more::derive::{Deref, DerefMut};
pub use range::*;

View File

@ -9,7 +9,7 @@ use core::{
use bevy_app::{App, Plugin, PostUpdate};
use bevy_ecs::{
component::Component,
entity::{hash_map::EntityHashMap, Entity},
entity::{Entity, EntityHashMap},
query::{Changed, With},
reflect::ReflectComponent,
removal_detection::RemovedComponents,

View File

@ -4,7 +4,7 @@ use crate::{
Extract, ExtractSchedule, Render, RenderApp, RenderSet, WgpuWrapper,
};
use bevy_app::{App, Plugin};
use bevy_ecs::{entity::hash_map::EntityHashMap, prelude::*};
use bevy_ecs::{entity::EntityHashMap, prelude::*};
use bevy_platform_support::collections::HashSet;
use bevy_utils::default;
use bevy_window::{

View File

@ -20,7 +20,7 @@ use bevy_app::{First, Plugin, Update};
use bevy_asset::{load_internal_asset, weak_handle, Handle};
use bevy_derive::{Deref, DerefMut};
use bevy_ecs::{
entity::hash_map::EntityHashMap, event::event_update_system, prelude::*, system::SystemState,
entity::EntityHashMap, event::event_update_system, prelude::*, system::SystemState,
};
use bevy_image::{Image, TextureFormatPixelInfo};
use bevy_platform_support::collections::HashSet;

View File

@ -2,7 +2,7 @@ use crate::{DynamicSceneBuilder, Scene, SceneSpawnError};
use bevy_asset::Asset;
use bevy_ecs::reflect::{ReflectMapEntities, ReflectResource};
use bevy_ecs::{
entity::{hash_map::EntityHashMap, Entity, SceneEntityMapper},
entity::{Entity, EntityHashMap, SceneEntityMapper},
reflect::{AppTypeRegistry, ReflectComponent},
world::World,
};
@ -217,7 +217,7 @@ where
mod tests {
use bevy_ecs::{
component::Component,
entity::{hash_map::EntityHashMap, Entity, EntityMapper, MapEntities},
entity::{Entity, EntityHashMap, EntityMapper, MapEntities},
hierarchy::ChildOf,
reflect::{AppTypeRegistry, ReflectComponent, ReflectMapEntities, ReflectResource},
resource::Resource,

View File

@ -5,7 +5,7 @@ use crate::{DynamicScene, SceneSpawnError};
use bevy_asset::Asset;
use bevy_ecs::{
component::ComponentCloneBehavior,
entity::{hash_map::EntityHashMap, Entity, SceneEntityMapper},
entity::{Entity, EntityHashMap, SceneEntityMapper},
entity_disabling::DefaultQueryFilters,
reflect::{AppTypeRegistry, ReflectComponent, ReflectResource},
relationship::RelationshipHookMode,

View File

@ -1,7 +1,7 @@
use crate::{DynamicScene, Scene};
use bevy_asset::{AssetEvent, AssetId, Assets, Handle};
use bevy_ecs::{
entity::{hash_map::EntityHashMap, Entity},
entity::{Entity, EntityHashMap},
event::{Event, EventCursor, Events},
hierarchy::ChildOf,
reflect::AppTypeRegistry,

View File

@ -515,7 +515,7 @@ mod tests {
DynamicScene, DynamicSceneBuilder,
};
use bevy_ecs::{
entity::{hash_map::EntityHashMap, Entity},
entity::{Entity, EntityHashMap},
prelude::{Component, ReflectComponent, ReflectResource, Resource, World},
query::{With, Without},
reflect::AppTypeRegistry,

View File

@ -7,7 +7,7 @@ use crate::{
use bevy_asset::Assets;
use bevy_color::LinearRgba;
use bevy_derive::{Deref, DerefMut};
use bevy_ecs::entity::hash_set::EntityHashSet;
use bevy_ecs::entity::EntityHashSet;
use bevy_ecs::{
change_detection::{DetectChanges, Ref},
component::Component,

View File

@ -4,7 +4,7 @@ use bevy_platform_support::collections::hash_map::Entry;
use taffy::TaffyTree;
use bevy_ecs::{
entity::{hash_map::EntityHashMap, Entity},
entity::{Entity, EntityHashMap},
prelude::Resource,
};
use bevy_math::{UVec2, Vec2};

View File

@ -9,7 +9,7 @@ use crate::{
use super::ComputedNode;
use bevy_ecs::{
change_detection::DetectChangesMut,
entity::{hash_set::EntityHashSet, Entity},
entity::{Entity, EntityHashSet},
hierarchy::ChildOf,
query::{Changed, With},
system::{Commands, Local, Query, Res},

View File

@ -16,7 +16,7 @@ use bevy_a11y::{
};
use bevy_app::{App, Plugin, PostUpdate};
use bevy_derive::{Deref, DerefMut};
use bevy_ecs::{entity::hash_map::EntityHashMap, prelude::*};
use bevy_ecs::{entity::EntityHashMap, prelude::*};
use bevy_window::{PrimaryWindow, Window, WindowClosed};
/// Maps window entities to their `AccessKit` [`Adapter`]s.

View File

@ -1,7 +1,7 @@
use bevy_a11y::AccessibilityRequested;
use bevy_ecs::entity::Entity;
use bevy_ecs::entity::hash_map::EntityHashMap;
use bevy_ecs::entity::EntityHashMap;
use bevy_platform_support::collections::HashMap;
use bevy_window::{
CursorGrabMode, MonitorSelection, VideoModeSelection, Window, WindowMode, WindowPosition,

View File

@ -11,7 +11,7 @@
//! In this example we're creating a [`Targeting`]/[`TargetedBy`] relationship,
//! demonstrating how you might model units which target a single unit in combat.
use bevy::ecs::entity::hash_set::EntityHashSet;
use bevy::ecs::entity::EntityHashSet;
use bevy::ecs::system::RunSystemOnce;
use bevy::prelude::*;

View File

@ -1,9 +1,7 @@
//! Control animations of entities in the loaded scene.
use std::collections::HashMap;
use bevy::{
animation::AnimationTarget, ecs::entity::hash_map::EntityHashMap, gltf::Gltf, prelude::*,
};
use bevy::{animation::AnimationTarget, ecs::entity::EntityHashMap, gltf::Gltf, prelude::*};
use crate::scene_viewer_plugin::SceneHandle;