Skip to content

Latest commit

 

History

History
190 lines (183 loc) · 44.5 KB

Friflo.Engine.ECS.md

File metadata and controls

190 lines (183 loc) · 44.5 KB

Friflo.Engine.ECS Namespace

Contains types and methods to query, add, remove or change Entity's in an EntityStore.

Classes
Archetype An Archetype store entities with a specific set of IComponent and ITag types.
See Example.
ArchetypeQuery ArchetypeQuery and all its generic implementations are designed to be reused.
By default, a query does not contain Disabled entities. Use WithDisabled() if needed.
See Example.
ArchetypeQuery<T1,T2,T3,T4,T5> A query instance use to retrieve the given component types. See Example.
ArchetypeQuery<T1,T2,T3,T4> A query instance use to retrieve the given component types. See Example.
ArchetypeQuery<T1,T2,T3> A query instance use to retrieve the given component types. See Example.
ArchetypeQuery<T1,T2> A query instance use to retrieve the given component types. See Example.
ArchetypeQuery<T1> A query instance use to retrieve the given component types. See Example.
ArchetypeUtils
BatchAlreadyAppliedException Is thrown if using a batch returned by Batch() after calling Apply().
BatchAlreadyReturnedException Is thrown if using a batch returned by Batch(bool) with autoReturn: true
after calling CreateEntity().
ChunkExtensions
CollectionExtensions
CommandBuffer A command buffer recording entity changes and execute these changes when calling Playback().
CommandBuffer is not thread safe. To record changes on arbitrary threads use Synced.
See Example.
CommandBufferSynced Same functionality as CommandBuffer but thread safe.
Use this command buffer to record entity changes in parallel queries executed via RunParallel().
ComponentKeyAttribute Assign a custom key used for JSON serialization for annotated IComponent and Script types.
If specified key is null The component type is not serialized.
ComponentSymbolAttribute Short symbol for a component, tag or script in UI or console as a name (max 3 chars) and a color.
Prefer using single character names for common used symbols. Consider Unicode characters.
ComponentType Provide meta data for an IComponent struct.
CreateEntityBatch A create batch is used to optimize entity creation.
Components and tags are buffered before creating an entity with CreateEntity().
See Example.
EntityBatch An entity batch is a container of component and tag commands that can be Apply()'ed to an entity.
It can be used on a single entity via Batch() or as a bulk operation an a set of entities.
EntityEqualityComparer Used to check if two Entity instances are the same entity by comparing their Id's.
EntityExtensions Provide extension methods to optimize Entity modifications.
Add() and Remove() cause only none or one structural change.
EntityList A list of entities of a specific EntityStore used to apply changes to all entities in the container.
It's recommended to reuse instances of this class to avoid unnecessary allocations.
See Example.
EntityReadOnlyCollection
EntitySchema Provide type information about all ITag, IComponent and Script types available in the application.
EntityStore An EntityStore is a container for Entity's their components, scripts, tags and the tree structure.
See Example.
EntityStoreBase Store the IComponents and ITag for the Entity's of an EntityStore.
EntityStoreExtensions Provide generic CreateEntity() overloads to create entities with passed components without any structural change.
EntityUtils
EventFilter Used to filter structural changes made to an entity like added / removed components / tags using HasEvent(int).
The EventRecorder must be enabled to get add / remove events.
See Example.
EventRecorder Used to record events of structural changes like add/remove component/tag.
The recorder is required to filter these events using an EventFilter.
GenericInstanceTypeAttribute The attribute is required to register specific type instances of generic component and tags types. See example in remarks.
IndexExtensions Provide extension methods to query all or specific component values.
Enables to query all or specific entity links (relationships).
MissingComponentException Is thrown when calling Entity.Set() on an entity missing the specified components.
NativeAOT
ParallelJobRunner Required for parallel - multi threaded - query job execution using RunParallel().
See Example.
QueryFilter Contains component and tags filters added to an ArchetypeQuery.
Multiple ArchetypeQuery's can share a single QueryFilter instance.
QueryJob A QueryJob enables Parallel query execution using multiple threads to reduce execution time of large queries.
They are created by the ArchetypeQuery.ForEach() methods.
QueryJob<T1,T2,T3,T4,T5> Enables Parallel query execution returning the specified components. See Example.
QueryJob<T1,T2,T3,T4> Enables Parallel query execution returning the specified components. See Example.
QueryJob<T1,T2,T3> Enables Parallel query execution returning the specified components. See Example.
QueryJob<T1,T2> Enables Parallel query execution returning the specified components. See Example.
QueryJob<T1> Enables Parallel query execution returning the specified components. See Example.
RawEntityStore A RawEntityStore enables using an entity store without using Entity's.
RelationExtensions
SchemaType Provide meta data for Script classes and IComponent / ITag structs.
Script To enable adding a script class to an Entity it need to extend Script.
See Example.
ScriptType Provide meta data for a Script class.
Signature A Signature specify the IComponent types used to query entity components
using the EntityStore.Query(Signature) methods.
StoreDispatcher Contains methods to dispatch execution of System.Action's or System.Func<>'s to the main thread.
TagNameAttribute Assign a custom tag name used for JSON serialization for annotated structs implementing ITag.
TagType Provide meta data for an ITag struct.
Structs
ChildEntities Return the child entities of an Entity.
To iterate all entities with child entities use TreeNode in a Query().
ChildEntitiesChanged Is the event for event handlers added to OnChildEntitiesChanged or OnChildEntitiesChanged.
ChildEnumerator Use to enumerate the child entities stored in Entity.ChildEntities.
Chunk<T> A Chunk<T> is container of struct components of Type T.
ChunkEntities Provide the entity Id's for Chunk<T> components using Ids or this[int].
ChunkEntitiesEnumerator Used to enumerate the Entity's of ChunkEntities.
ChunkEnumerator<T1,T2,T3,T4,T5>
ChunkEnumerator<T1,T2,T3,T4>
ChunkEnumerator<T1,T2,T3>
ChunkEnumerator<T1,T2>
ChunkEnumerator<T1>
Chunks<T1,T2,T3,T4,T5> Contains the components returned by a component query. See Example.
Chunks<T1,T2,T3,T4> Contains the components returned by a component query. See Example.
Chunks<T1,T2,T3> Contains the components returned by a component query. See Example.
Chunks<T1,T2> Contains the components returned by a component query. See Example.
Chunks<T1> Contains the components returned by a component query. See Example.
ComponentChanged Is the event for event handlers added to OnComponentChanged, OnComponentAdded or OnComponentRemoved.
ComponentEnumerator Enumerate the components of an entity by iterating EntityComponents.
ComponentIndex<TIndexedComponent,TValue> The index for IIndexedComponent<TValue> struct's to search entities with a specific component value in O(1).
An instance is returned via ComponentIndex<TIndexedComponent,TValue>(this EntityStore).
ComponentTypes ComponentTypes define a set of IComponent's used to list the component System.Type's of an Archetype.
ComponentTypesEnumerator Return the IComponent types of ComponentTypes.
DebugEventHandler Used as item type in DebugEventHandlers providing the number of handlers for a specific event Type.
DebugEventHandlers Provide the event / signal handlers of an entity using Entity.DebugEventHandlers.
Disabled If entity Enabled == false it is tagged with Disabled.
Disabled entities are excluded from query results by default. To include use WithDisabled().
EngineDependant
Entities
EntitiesChanged
EntitiesEnumerator Used to enumerate the Entities of an ArchetypeQuery.
Entity Represent an object in an EntityStore - e.g. a cube in a game scene.
It is the main API to deal with entities in the engine.
See Example.
EntityComponent An item in EntityComponents containing an entity IComponent.
EntityComponents Return the IComponent's added to an Entity.
EntityCreate Is the event for event handlers added to OnEntityCreate.
EntityData An EntityData is used to optimize access of entity components and tags.
An instance can be returned by Data.
EntityDelete Is the event for event handlers added to OnEntityDelete.
EntityEnumerator
EntityEvent The information about a structural change recorded by the EventRecorder.
EntityLink
EntityLink<TComponent>
EntityLinkEnumerator
EntityLinkEnumerator<T>
EntityLinks
EntityLinks<T>
EntityListEnumerator Enumerates the entities of an EntityList.
EntityName Can be added to an Entity to provide a descriptive name for debugging or in an editor.
EntityNode Used by the EntityStore to store Entity components, scripts, tags and child entities internally as an array of nodes.
EntityReadOnlyCollectionEnumerator
EntityRelations<TRelation> Storage for all entity relations of the specified TRelation type.
An instance is returned via EntityRelations<TRelation>(this EntityStore).
EntityScripts Return the Script's added to an Entity.
EntityScriptsEnumerator Used to enumerate the Script's added to an Entity.
EntityStoreInfo
LinkComponentIndex<TLinkComponent> The index for ILinkComponent struct's to search entities with a specific entity in O(1).
Position
QueryChunks<T1,T2,T3,T4,T5> Contains the component chunks returned by a component query. See Example.
QueryChunks<T1,T2,T3,T4> Contains the component chunks returned by a component query. See Example.
QueryChunks<T1,T2,T3> Contains the component chunks returned by a component query. See Example.
QueryChunks<T1,T2> Contains the component chunks returned by a component query. See Example.
QueryChunks<T1> Contains the component chunks returned by a component query. See Example.
QueryEntities Provide the result set of an ArchetypeQuery as a set of Entity's.
QueryFilter.FilterCondition Contains component and tag filter conditions added to an ArchetypeQuery.
ReadOnlyList<T> Represents a strongly typed readonly list of objects that can be accessed by index.
ReadOnlyListEnumerator<T> Enumerates the elements of a ReadOnlyList<T>.
Relations<TRelation> Contains the relations of a specific entity returned by GetRelations<TRelation>(this Entity).
RelationsEnumerator<TRelation>
Rotation Rotation encoded as a Quaternion described by the mathematician W.R. Hamilton.
Scale3
ScriptChanged Is the event for event handlers added to OnScriptChanged, OnScriptAdded or OnScriptRemoved.
Scripts Contains the Script's added to an entity.
ScriptsEnumerator Enumerator for entity Scripts.
Signal<TEvent> Signal<TEvent>'s are used to emit custom events from an entity to custom Signal<TEvent> handlers.
See Example.
Signature<T1,T2,T3,T4,T5> A Signature used to create a query using Query<T1,T2,T3,T4,T5>(Signature<T1,T2,T3,T4,T5>) with five components.
Signature<T1,T2,T3,T4> A Signature to create a query using Query<T1,T2,T3,T4>(Signature<T1,T2,T3,T4>) with four components.
Signature<T1,T2,T3> A Signature to create a query using Query<T1,T2,T3>(Signature<T1,T2,T3>) with three components.
Signature<T1,T2> A Signature to create a query using Query<T1,T2>(Signature<T1,T2>) with two components.
Signature<T1> A Signature to create a query using Query<T1>(Signature<T1>) with one component.
SymbolColor The color assigned to a component or tag via ComponentSymbolAttribute for display in a UI or CLI.
Tags Tags define a set of ITag's used to query entities in an EntityStoreBase.
TagsChanged Is the event for event handlers added to OnTagsChanged or OnTagsChanged.
TagsEnumerator Used to enumerate the ITag's stored in Tags.
Transform
TreeNode A TreeNode component stores the ChildEntities of an Entity.
It is used to build up an entity hierarchy used for scene graphs.
UniqueEntity A UniqueEntity is used to assign a unique string to an entity within an EntityStore.
Unresolved Unresolved is a container for unresolved entity components.
UnresolvedComponent Is used as item type for Unresolved.components storing unresolved entity components.
UpdateTick Specify deltaTime and time for system execution in Update(UpdateTick).
Interfaces
ICommandBuffer
IComponent To enable adding a struct component to an Entity it need to implement IComponent.
IComponent types are structs which only contains data but no script / methods.
See Example.
IEach<T1,T2,T3,T4,T5>
IEach<T1,T2,T3,T4>
IEach<T1,T2,T3>
IEach<T1,T2>
IEach<T1>
IEachEntity<T1,T2,T3,T4,T5>
IEachEntity<T1,T2,T3,T4>
IEachEntity<T1,T2,T3>
IEachEntity<T1,T2>
IEachEntity<T1>
IIndexedComponent<TValue> Is used to define a component type having a single indexed field / property.
Indexed component values can be queried with HasValue() or ValueInRange() in a Query().
ILinkComponent A link component is a component type used to create a single link from one entity to another entity.
Specific component links can be queried with HasValue() in a Query().
ILinkRelation A link relation is a component type used to create multiple links from one entity to other entities.
IRelation
IRelation<TKey> A relation enables adding multiple components of the same type to an entity.
The components added to a single entity build a set of components using the relation TKey as unique identifier.
IStoreDispatcher
ITag Used to create entity Tag's by declaring a struct without fields or properties extending ITag.
Note: An ITag should be used to tag a group of multiple entities.
See Example.
Enums
ChildEntitiesChangedAction The modification type of an ChildEntitiesChanged event: Add or Remove entity.
ComponentChangedAction The modification type of a ComponentChanged event: Remove, Add or Update component.
DebugEntityEventKind Event type of a DebugEventHandler: Event or Signal.
EntityEventAction The type of an entity change in EntityEvent.
JobExecution Specify the way how ChunkEntities are provided by either a foreach loop, Run() or RunParallel().
NodeFlags Flags assigned to EntityNode's internally stored in an EntityStore.
PidType Specify the way how an EntityStore generates entity Pid's.
SchemaTypeKind Declares the Kind of a SchemaType
ScriptChangedAction The modification type of a ScriptChanged event: Remove, Add or Replace script.
StoreOwnership Describe the ownership state of an Entity
TreeMembership Describe the membership of an Entity to the EntityStore tree graph.
Delegates
ForEachEntity<T1,T2,T3,T4,T5>(T1, T2, T3, T4, T5, Entity) Provide the state of an entity within ForEachEntity(ForEachEntity<T1,T2,T3,T4,T5>).
ForEachEntity<T1,T2,T3,T4>(T1, T2, T3, T4, Entity) Provide the state of an entity within ForEachEntity(ForEachEntity<T1,T2,T3,T4>).
ForEachEntity<T1,T2,T3>(T1, T2, T3, Entity) Provide the state of an entity within ForEachEntity(ForEachEntity<T1,T2,T3>).
ForEachEntity<T1,T2>(T1, T2, Entity) Provide the state of an entity within ForEachEntity(ForEachEntity<T1,T2>).
ForEachEntity<T1>(T1, Entity) Provide the state of an entity within ForEachEntity(ForEachEntity<T1>).