#[repr(C)]pub struct ecs_type_t {
pub array: *mut u64,
pub count: i32,
}Expand description
A type is a list of (component) ids. Types are used to communicate the “type” of an entity. In most type systems a typeof operation returns a single type. In ECS however, an entity can have multiple components, which is why an ECS type consists of a vector of ids.
The component ids of a type are sorted, which ensures that it doesn’t matter in which order components are added to an entity. For example, if adding Position then Velocity would result in type [Position, Velocity], first adding Velocity then Position would also result in type [Position, Velocity].
Entities are grouped together by type in the ECS storage in tables. The storage has exactly one table per unique type that is created by the application that stores all entities and components for that type. This is also referred to as an archetype.
Fields§
§array: *mut u64§count: i32Trait Implementations§
Source§impl Clone for ecs_type_t
impl Clone for ecs_type_t
Source§fn clone(&self) -> ecs_type_t
fn clone(&self) -> ecs_type_t
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more