Flecs v3.2
A fast entity component system (ECS) for C & C++
No Matches
ecs_type_t Struct Reference

A type is a list of (component) ids. More...

#include <flecs.h>

Public Attributes

int32_t count

Detailed 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.

Definition at line 335 of file flecs.h.

Member Data Documentation

◆ array

ecs_id_t* ecs_type_t::array

Definition at line 336 of file flecs.h.

◆ count

int32_t ecs_type_t::count

Definition at line 337 of file flecs.h.

The documentation for this struct was generated from the following file: