1use super::{Component, ComponentStorage, Entity, EntityId, EntityStorage};
4use crate::collections::{GenIndexArena, GenIndexBTreeMap, GenIndexSparseSet, GenIndexVecMap};
5
6pub type ArenaStorage<E> = GenIndexArena<E, EntityId<E>>;
8
9impl<E: Entity + 'static> EntityStorage<E> for ArenaStorage<E> {}
11
12pub type SparseSetStorage<E, C> = GenIndexSparseSet<C, EntityId<E>>;
14
15impl<E: Entity + 'static, C: Component<E> + 'static> ComponentStorage<E, C>
16 for SparseSetStorage<E, C>
17{
18}
19
20pub type VecStorage<E, C> = GenIndexVecMap<C, EntityId<E>>;
22
23impl<E: Entity + 'static, C: Component<E> + 'static> ComponentStorage<E, C> for VecStorage<E, C> {}
24
25pub type BTreeStorage<E, C> = GenIndexBTreeMap<C, EntityId<E>>;
27
28impl<E: Entity + 'static, C: Component<E> + 'static> ComponentStorage<E, C> for BTreeStorage<E, C> {}
29
30#[cfg(feature = "std")]
32pub type HashMapStorage<E, C> = crate::collections::GenIndexHashMap<C, EntityId<E>>;
33
34#[cfg(feature = "std")]
35impl<E: Entity + 'static, C: Component<E> + 'static> ComponentStorage<E, C>
36 for HashMapStorage<E, C>
37{
38}