EasyEcs
API reference

API reference

Every public type of EasyEcs.Core with its members, generated from the XML documentation.

Everything is in namespace EasyEcs. These pages are generated from the XML documentation of EasyEcs.Core; the members the generator writes for your own components (entity.Position, world.Clock, SetDead()) are in Entities and components, and the complexity of every call in API and complexity.

Classes

TypeSummary
ChangedAttribute<T>The ForEachAttribute method visits only entities whose T was written since its system last ran (EcsSystem.LastRunTick; on the first run, every entity having it).
DynamicBufferExtensionsThe writes of a DynamicBuffer.
EcsSystemLogic that runs on a world.
ForEachAttributeRuns a method of an EcsSystem (or a static method of any other type, through a generated entry point) for every entity matching its component parameters (and the WithAttribute / WithoutAttribute / WithAnyAttribute filters), each update, after EcsSystem.OnUpdate, in declaration order.
OrderedIndexExtensionsOrdered walks of a value index whose key is comparable (a score, a deadline, a level): ranges and sorted iteration for leaderboards, timers and matchmaking brackets.
PrefabA recipe for entities: a set of component values that belongs to no world, so no query ever sees it.
RelationIndex<T>The links of relation T in one world, by target (World.Relations): which entities link to an entity, O(1) to start and O(1) per link.
RemovedAttribute<T>The ForEachAttribute method visits only entities that lost T since its system last ran (EcsSystem.LastRunTick) and have not got it back: replication sends the removal, a cleanup releases what the component stood for.
TargetRulesTarget policies of components that point at an entity (IIndexed of EntityId).
UpdateAfterAttribute<TSystem>Run this system after TSystem (and systems derived from it) of the same group: see UpdateBeforeAttribute.
UpdateBeforeAttribute<TSystem>Run this system before TSystem (and systems derived from it) of the same group, whatever their registration order.
UpdateInGroupAttribute<TGroup>Puts the system (and derived systems) into group TGroup.
ValueIndex<T, TKey>The value index of component T in one world (World.Index).
WithAnyAttribute<T>The ForEachAttribute method requires at least one of the components named by its [WithAny<T>] attributes (not passed in): [ForEach, WithAny<Burning>, WithAny<Poisoned>].
WithAttribute<T>The ForEachAttribute method also requires component T (not passed in).
WithoutAttribute<T>The ForEachAttribute method skips entities having component T.
WorldAn ECS world: entities, their components, singletons and the systems that update them.
WorldOptionsConfiguration of a World.
WorldSnapshotA copy of a world's entities, components and singletons, taken by World.Capture and put back by World.Restore (systems and options are not part of it).

Structs

TypeSummary
ChildOfThe hierarchy relation: the entity is a child of ChildOf.Parent.
ColumnInfoA column of a table (TableInfo).
ComponentSetA set of component types, built once and kept (a static readonly field): the components a save writes (World.SaveEntities), the record of what persists without the runtime state around it.
ComponentValueA component of an entity, as Entity.Describe reads it: a boxed copy of its value.
DestroyedTag of an entity that was destroyed while holding ICleanupComponents: its other components are gone, it stays alive until its last cleanup component is removed.
Disabled<T>The tag of an entity whose T is disabled (Entity.Disable): the entity keeps the value of T but lacks it for queries, Has and Get until Entity.Enable gives it back.
DynamicBuffer<T>A list of T per entity, held as a component: an inventory, a path, the hits of this tick.
EntityHandle to an entity: id + version + world (16 bytes).
EntityIdThe identity of an entity: its index and the incarnation of that index (8 bytes, unmanaged).
EntitySpanThe entities of one run of rows in a batch job: element i is the entity whose components are element i of the run's spans.
Maybe<T>An optional component of the entity a [ForEach] method visits: static void Regen(ref Health h, Maybe<Buff> buff) visits every entity with Health, and Maybe.HasValue tells whether this one also has a Buff.
QueryEnumerator<T1..T9>Allocation-free query enumerator; safe under structural changes during iteration (same visiting rules as ForEach).
QueryFilterExtra query constraints: components that must be present without being read (QueryFilter.With) or must be absent (QueryFilter.Without).
QueryItem<T1..T9>One query result: the entity and refs into its row.
RelationIndex<T>.SourcesEnumerates the entities linking to one target (foreach), once per link.
SingletonRef<T>Handle to one world's singleton T.
SystemAccessThe data a system reads and writes, declared once when the system is added.
SystemListThe systems of a world, every group in execution order (default group first): foreach it, or read SystemList.Count.
SystemList.EnumeratorWalks the groups and their systems.
SystemStatsHow often and how long a system ran (WorldOptions.MeasureSystems): EcsSystem.OnUpdate plus its [ForEach] methods, per run.
TableInfoA table: the entities with one set of component columns (World.Describe).
ValueIndex<T, TKey>.MatchesEnumerates the entities of one key (foreach).
ValueIndex<T, TKey>.OrderedEnumerates entities in key order (foreach): every entity of a key, then the next key.
World.DescendantWalkA depth-first walk of World.Descendants: a stack of the child lists still being read, given back to the world by World.DescendantWalk.Dispose (foreach calls it).
World.EntityEnumeratorEnumerates alive entities in id order; ids beyond the capacity captured at start are not visited.
World.SubtreeThe descendants of an entity (World.Descendants): each foreach walks them anew.

Interfaces

TypeSummary
ICleanupComponentMarks a component that outlives the destruction of its entity: destroying an entity holding one removes its other components and adds the Destroyed tag instead of freeing it, so a system can release what the component stands for (a socket, a reservation, a slot in another service) and then remove it.
IComponentMarks a struct as component data.
IForEach<T1..T9>Struct callback for World.ForEach.
IForEachBatch<T1..T9>Struct callback for World.ForEachBatch: receives whole runs of rows as spans, one per component, so the job can process them with SIMD (System.Numerics.Vector, MemoryMarshal.Cast), and their entities (built only when indexed).
IForEachEntity<T1..T9>Like IForEach but also receives the Entity handle, built from the archetype's entity rows (id and version side by side) without a per-entity lookup.
IGroupMarks a component whose value splits tables: in a world that called World.GroupBy, entities with different IGroup.Groups live in different tables, so a query of one group (QueryFilter.InGroup) walks only its own rows, contiguous in memory (a zone, a map, a match, a team).
IGroupWith<T>A system group whose [ForEach] methods visit only entities with T, as WithAttribute on the group would.
IGroupWithout<T>A system group whose [ForEach] methods skip entities with T, as WithoutAttribute on the group would (see IGroupWith).
IIndexed, IIndexed<TKey>What every IIndexed is, so a component type is known to be indexed without reflection (a type test the JIT folds).
INoStructuralChangesMarks a ForEach job that makes no structural change (no create/destroy/add/remove/set on any entity of the world it iterates).
IRelationAn element of a DynamicBuffer that links its entity to IRelation.Target: an entity holds any number of links of one kind (the members of a party, the items a merchant offers, the units a buff applies to), and World.Relations finds the entities linking to a target.
ISingletonComponentMarks a struct as a world singleton: exactly one value per world (clock, configuration, shared state).
ISystemGroupMarker of a system group: systems marked UpdateInGroupAttribute run together when World.Update is called, independently of the default group run by World.Update.
ITrackChangesMarks a component whose changes are tracked: every row records the world's World.ChangeTick of its last write, and [Changed<T>] / QueryFilter.Changed<T>(since) select the rows written since a system last ran.

Enums

TypeSummary
SystemErrorPolicyWhat an exception thrown by a system does (WorldOptions.SystemErrors).
TargetPolicyWhat happens to the links to an entity when it is destroyed (TargetRules.WhenTargetDestroyed, RelationIndex.WhenTargetDestroyed).

Delegates

TypeSummary
EntityIdField<T>An EntityId field of value (see SavedTypes.EntityIds).
Edit on GitHub

Last updated on

How is this guide?

On this page