Flecs v4.0
A fast entity component system (ECS) for C & C++
|
A type is a list of (component) ids. More...
#include <flecs.h>
Public Attributes | |
ecs_id_t * | array |
Array with ids. | |
int32_t | count |
Number of elements in array. | |
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.