EasyEcs
API reference

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…

public interface IForEachBatch<T1> where T1 : struct, IComponent
public interface IForEachBatch<T1, T2> where T1 : struct, IComponent where T2 : struct, IComponent
public interface IForEachBatch<T1, T2, T3> where T1 : struct, IComponent where T2 : struct, IComponent where T3 : struct, IComponent
public interface IForEachBatch<T1, T2, T3, T4> where T1 : struct, IComponent where T2 : struct, IComponent where T3 : struct, IComponent where T4 : struct, IComponent
public interface IForEachBatch<T1, T2, T3, T4, T5> where T1 : struct, IComponent where T2 : struct, IComponent where T3 : struct, IComponent where T4 : struct, IComponent where T5 : struct, IComponent
public interface IForEachBatch<T1, T2, T3, T4, T5, T6> where T1 : struct, IComponent where T2 : struct, IComponent where T3 : struct, IComponent where T4 : struct, IComponent where T5 : struct, IComponent where T6 : struct, IComponent
public interface IForEachBatch<T1, T2, T3, T4, T5, T6, T7> where T1 : struct, IComponent where T2 : struct, IComponent where T3 : struct, IComponent where T4 : struct, IComponent where T5 : struct, IComponent where T6 : struct, IComponent where T7 : struct, IComponent
public interface IForEachBatch<T1, T2, T3, T4, T5, T6, T7, T8> where T1 : struct, IComponent where T2 : struct, IComponent where T3 : struct, IComponent where T4 : struct, IComponent where T5 : struct, IComponent where T6 : struct, IComponent where T7 : struct, IComponent where T8 : struct, IComponent
public interface IForEachBatch<T1, T2, T3, T4, T5, T6, T7, T8, T9> where T1 : struct, IComponent where T2 : struct, IComponent where T3 : struct, IComponent where T4 : struct, IComponent where T5 : struct, IComponent where T6 : struct, IComponent where T7 : struct, IComponent where T8 : struct, IComponent where T9 : struct, IComponent

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). [ForEach] methods taking Span<T> / ReadOnlySpan<T> compile to this.

One type per number of components, 1 to 9 (generated from one template); the members below are those of each, shown for IForEachBatch<T1>.

Properties

Writes

static virtual int Writes { get; }

Components the job writes through its refs: bit k - 1 for component k (default: all). When the job changes the archetype of the entity it visits, ForEach carries those components over from the row the refs point into to the entity's new row after the job returns. Generated jobs set only their ref parameters.

Methods

Execute

void Execute(EntitySpan entities, Span<T1> c1);

One run of consecutive rows of one archetype: element i of entities and of every span belongs to the same entity.

Edit on GitHub

Last updated on

How is this guide?

On this page