[−][src]Struct dces::entity::EntityComponentManager
The EntityComponentManager represents the main entity and component storage.
Fields
entities: HashMap<Entity, HashMap<TypeId, Box<dyn Any>>>
The entities with its components.
Methods
impl EntityComponentManager
[src]
impl EntityComponentManager
pub fn new() -> Self | [src] |
Create sa new entity component manager.
pub fn register_entity(&mut self, entity: Entity) | [src] |
Register a new entity
.
pub fn remove_entity(&mut self, entity: Entity) | [src] |
Removes a entity
from the manager.
pub fn register_component<C: Component>(&mut self, entity: Entity, component: C) | [src] |
Register a component
for the given entity
.
pub fn register_shared_component<C: Component>( | [src] |
pub fn register_shared_component_box( | [src] |
pub fn register_component_box( | [src] |
Register a component_box
for the given entity
.
pub fn borrow_component<C: Component>( | [src] |
Returns a reference of a component of type C
from the given entity
. If the entity does
not exists or it dosen't have a component of type C
NotFound
will be returned.
pub fn borrow_mut_component<C: Component>( | [src] |
Returns a mutable reference of a component of type C
from the given entity
. If the entity does
not exists or it dosen't have a component of type C
NotFound
will be returned.
Trait Implementations
impl Default for EntityComponentManager
[src]
impl Default for EntityComponentManager
fn default() -> EntityComponentManager | [src] |
Auto Trait Implementations
impl !Send for EntityComponentManager
impl !Send for EntityComponentManager
impl !Sync for EntityComponentManager
impl !Sync for EntityComponentManager
Blanket Implementations
impl<T> Component for T where
T: Any,
[src]
impl<T> Component for T where
T: Any,
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |