public sealed class ArchetypeEvery entity that has exactly one particular set of components, and the chunks holding them.
No guide page documents this yet — the page shows what the code says about itself.
Remarks
An archetype is created the first time an entity needs it and lives as long as the world, because a query caches the archetypes it matched and a mask taken before one disappeared would start meaning something else.
The add/remove edges are the single biggest difference between a naive archetype ECS and a good one: Add<Velocity> on an entity that already has Position is a dictionary hit on this archetype, not a hash of a recomputed type set.
Fields and properties (9)
public const int ChunkBudgetHow large a chunk is, before an archetype too wide to fit one entity overrides it.
public ComponentSignature SignatureThe component types every entity here has, sorted.
public BitSet MaskThe same set as a bit per component id, which is what a query tests against.
public int EntityCountHow many entities are in the archetype.
public int ColumnCountHow many components have chunk storage. Tags do not, so this can be less than the signature.
public int ChunkCapacityHow many entities one chunk holds.
public int ChunkBytesHow many bytes one chunk is.
public IReadOnlyList<Chunk> ChunksThe chunks, in no meaningful order.
public World WorldThe world this belongs to. An archetype is never shared between worlds.
Methods (3)
public int ColumnOf(ComponentTypeId id)The chunk column a component occupies here, or -1 if it is a tag or not present.
public bool Has(ComponentTypeId id)Whether an entity here has the component, including tags.
public override string ToString()Renders the component set, which is what a diagnostic wants to see.
Used by (23)
- ChunkVixen.Ecs
- ChunkSequenceVixen.Ecs
- CommandBufferTestsVixen.Ecs.Tests
- EntityInfoVixen.Ecs
- EnumeratorVixen.Ecs
- PrefabVixen.Engine
- QueryVixen.Ecs
- QueryDescriptionVixen.Ecs
- QueryTestsVixen.Ecs.Tests
- RecreateTestsVixen.Ecs.Tests
- SceneContentVixen.Engine
- StructuralPropertyTestsVixen.Ecs.Tests
- WorldVixen.Ecs
- WorldDigestVixen.Ecs
- WorldSerializerVixen.Engine
- WorldTestsVixen.Ecs.Tests
- ItemVixen.Editor.SceneView
- SceneCloneVixen.Editor.SceneView
- SceneSerializerVixen.Editor.SceneView
- SceneStatisticsVixen.Editor.Profiler
- SceneTestsVixen.Editor.SceneView.Tests
- SubtreeSnapshotVixen.Editor.SceneView
- WorldSnapshotVixen.Editor.SceneView