Trait shipyard::AddComponent [−][src]
Defines how components are added to an existing entity.
Associated Types
Loading content...Required methods
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)
Adds component
to entity
, multiple components can be added at the same time using a tuple.
This function does not check entity
is alive. It’s possible to add components to removed entities.
Use Entities::add_component
if you’re unsure.
Example
use shipyard::{World, EntitiesViewMut, ViewMut, AddComponent}; let world = World::new(); let (mut entities, mut u32s) = world.borrow::<(EntitiesViewMut, ViewMut<u32>)>().unwrap(); let entity = entities.add_entity((), ()); u32s.add_component_unchecked(entity, 0);
Implementations on Foreign Types
impl AddComponent for ()
[src]
impl<ViewA: AddComponent> AddComponent for (ViewA,)
[src]
type Component = (ViewA::Component,)
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)
impl<ViewA: AddComponent, ViewB: AddComponent> AddComponent for (ViewA, ViewB)
[src]
type Component = (ViewA::Component, ViewB::Component)
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)
impl<ViewA: AddComponent, ViewB: AddComponent, ViewC: AddComponent> AddComponent for (ViewA, ViewB, ViewC)
[src]
type Component = (ViewA::Component, ViewB::Component, ViewC::Component)
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)
impl<ViewA: AddComponent, ViewB: AddComponent, ViewC: AddComponent, ViewD: AddComponent> AddComponent for (ViewA, ViewB, ViewC, ViewD)
[src]
type Component = (ViewA::Component, ViewB::Component, ViewC::Component, ViewD::Component)
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)
impl<ViewA: AddComponent, ViewB: AddComponent, ViewC: AddComponent, ViewD: AddComponent, ViewE: AddComponent> AddComponent for (ViewA, ViewB, ViewC, ViewD, ViewE)
[src]
type Component = (ViewA::Component, ViewB::Component, ViewC::Component, ViewD::Component, ViewE::Component)
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)
impl<ViewA: AddComponent, ViewB: AddComponent, ViewC: AddComponent, ViewD: AddComponent, ViewE: AddComponent, ViewF: AddComponent> AddComponent for (ViewA, ViewB, ViewC, ViewD, ViewE, ViewF)
[src]
type Component = (ViewA::Component, ViewB::Component, ViewC::Component, ViewD::Component, ViewE::Component, ViewF::Component)
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)
impl<ViewA: AddComponent, ViewB: AddComponent, ViewC: AddComponent, ViewD: AddComponent, ViewE: AddComponent, ViewF: AddComponent, ViewG: AddComponent> AddComponent for (ViewA, ViewB, ViewC, ViewD, ViewE, ViewF, ViewG)
[src]
type Component = (ViewA::Component, ViewB::Component, ViewC::Component, ViewD::Component, ViewE::Component, ViewF::Component, ViewG::Component)
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)
impl<ViewA: AddComponent, ViewB: AddComponent, ViewC: AddComponent, ViewD: AddComponent, ViewE: AddComponent, ViewF: AddComponent, ViewG: AddComponent, ViewH: AddComponent> AddComponent for (ViewA, ViewB, ViewC, ViewD, ViewE, ViewF, ViewG, ViewH)
[src]
type Component = (ViewA::Component, ViewB::Component, ViewC::Component, ViewD::Component, ViewE::Component, ViewF::Component, ViewG::Component, ViewH::Component)
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)
impl<ViewA: AddComponent, ViewB: AddComponent, ViewC: AddComponent, ViewD: AddComponent, ViewE: AddComponent, ViewF: AddComponent, ViewG: AddComponent, ViewH: AddComponent, ViewI: AddComponent> AddComponent for (ViewA, ViewB, ViewC, ViewD, ViewE, ViewF, ViewG, ViewH, ViewI)
[src]
type Component = (ViewA::Component, ViewB::Component, ViewC::Component, ViewD::Component, ViewE::Component, ViewF::Component, ViewG::Component, ViewH::Component, ViewI::Component)
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)
impl<ViewA: AddComponent, ViewB: AddComponent, ViewC: AddComponent, ViewD: AddComponent, ViewE: AddComponent, ViewF: AddComponent, ViewG: AddComponent, ViewH: AddComponent, ViewI: AddComponent, ViewJ: AddComponent> AddComponent for (ViewA, ViewB, ViewC, ViewD, ViewE, ViewF, ViewG, ViewH, ViewI, ViewJ)
[src]
type Component = (ViewA::Component, ViewB::Component, ViewC::Component, ViewD::Component, ViewE::Component, ViewF::Component, ViewG::Component, ViewH::Component, ViewI::Component, ViewJ::Component)
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)
Implementors
impl<T: 'static> AddComponent for &mut ViewMut<'_, T>
[src]
type Component = T
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)
impl<T: 'static> AddComponent for ViewMut<'_, T>
[src]
type Component = T
fn add_component_unchecked(
&mut self,
entity: EntityId,
component: Self::Component
)
[src]
&mut self,
entity: EntityId,
component: Self::Component
)