bevy_ecs/component/constants.rs
1//! Constant components included in every world.
2
3use crate::component::ComponentId;
4
5/// [`ComponentId`] of the [`Add`](crate::lifecycle::Add) component used in lifecycle observers.
6pub const ADD: ComponentId = ComponentId::new(0);
7/// [`ComponentId`] of the [`Insert`](crate::lifecycle::Insert) component used in lifecycle observers.
8pub const INSERT: ComponentId = ComponentId::new(1);
9/// [`ComponentId`] of the [`Discard`](crate::lifecycle::Discard) component used in lifecycle observers.
10pub const DISCARD: ComponentId = ComponentId::new(2);
11/// [`ComponentId`] of the [`Remove`](crate::lifecycle::Remove) component used in lifecycle observers.
12pub const REMOVE: ComponentId = ComponentId::new(3);
13/// [`ComponentId`] of the [`Despawn`](crate::lifecycle::Despawn) component used in lifecycle observers.
14pub const DESPAWN: ComponentId = ComponentId::new(4);
15/// [`ComponentId`] of the [`IsResource`](crate::resource::IsResource) component used to mark entities with resources.
16pub const IS_RESOURCE: ComponentId = ComponentId::new(5);
17/// [`ComponentId`] of the [`ArchetypeCreated`](crate::archetype::ArchetypeCreated) component used as an observer event key.
18pub(crate) const ARCHETYPE_CREATED: ComponentId = ComponentId::new(6);