Expand description
Types for defining Archetype
s, collections of entities that have the same set of
components.
An archetype uniquely describes a group of entities that share the same components: a world only has one archetype for each unique combination of components, and all entities that have those components and only those components belong to that archetype.
Archetypes are not to be confused with Table
s. Each archetype stores its table
components in one table, and each archetype uniquely points to one table, but multiple
archetypes may store their table components in the same table. These archetypes
differ only by the SparseSet
components.
Like tables, archetypes can be created but are never cleaned up. Empty archetypes are not removed, and persist until the world is dropped.
Archetypes can be fetched from Archetypes
, which is accessible via World::archetypes
.
Structs§
- Archetype
- Metadata for a single archetype within a
World
. - Archetype
Component Id - An opaque unique joint ID for a
Component
in anArchetype
within aWorld
. - Archetype
Entity - Metadata about an
Entity
in aArchetype
. - Archetype
Generation - The next
ArchetypeId
in anArchetypes
collection. - Archetype
Id - An opaque unique ID for a single
Archetype
within aWorld
. - Archetype
Record - Metadata about how a component is stored in an
Archetype
. - Archetype
Row - An opaque location within a
Archetype
. - Archetypes
- The backing store of all
Archetype
s within aWorld
. - Edges
- Archetypes and bundles form a graph. Adding or removing a bundle moves
an
Entity
to a newArchetype
.
Type Aliases§
- Component
Index - Maps a
ComponentId
to the list ofArchetypes
that contain theComponent
, along with anArchetypeRecord
which contains some metadata about how the component is stored in the archetype.