RawEntityStore.md

November 22, 2024 ยท View on GitHub

Friflo.Engine.ECS

Friflo.Engine.ECS

RawEntityStore Class

A RawEntityStore enables using an entity store without using Entity's.

public sealed class RawEntityStore : Friflo.Engine.ECS.EntityStoreBase

Inheritance System.Object ๐Ÿก’ EntityStoreBase ๐Ÿก’ RawEntityStore

Remarks

The focus of the this entity store implementation is performance.
The key is to minimize heap consumption required by EntityNode's - 48 bytes
A RawEntityStore stores only an array of blittable Friflo.Engine.ECS.RawEntityNode's - structs having no reference type fields.

The downside of this approach are:

  • Entities can be created only programmatically but not within the editor which requires (managed) Entity's.
  • The API to access / query / mutate Friflo.Engine.ECS.RawEntityNode's is less convenient.
    It requires always two parameters - a RawEntityStore + entity id - instead of a single Entity reference.
Methods
AddEntityComponent<T>(int, T)
AddEntityTags(int, Tags)
CreateEntity()
CreateEntity(Archetype)Creates a new entity with the components and tags of the given archetype
CreateEntity(int)
DeleteEntity(int)
EnsureEntityCapacity(int)
GetEntityArchetype(int)
GetEntityComponent<T>(int)
GetEntityComponentCount(int)
GetEntityTags(int)
RemoveEntityComponent<T>(int)
RemoveEntityTags(int, Tags)
UpdateEntityCompIndex(int, int)