pub trait Component {
    fn maintain_ordering() -> bool
    where
        Self: Sized
, { ... } fn capacity_hint() -> usize
    where
        Self: Sized
, { ... } fn add_priority() -> i32
    where
        Self: Sized
, { ... } }
Expand description

A data struct which may be added to an Entity

Provided Methods

Whether to maintain insertion order when removing components. By default, the slower method that maintains ordering is used. The performance penalty is based on the size of the data in the component type, so it is a good idea to disable this for larger components that don’t need strict ordering, as the faster swap removal method is used. Keep in mind that this will disturb the iteration order of the components in the store.

How many components of this type that memory should be reserved for in advance.

The priority used to determine which component types are added to the scene first when doing deferred spawns. Lower numbers are added first.

Implementors