EasyEcs
API reference

IForEach<T1..T9>

Struct callback for World.ForEach. The IForEach<T1..T9> interface of EasyEcs, the C# ECS: its members, parameters and complexity.

public interface IForEach<T1> where T1 : struct, IComponent
public interface IForEach<T1, T2> where T1 : struct, IComponent where T2 : struct, IComponent
public interface IForEach<T1, T2, T3> where T1 : struct, IComponent where T2 : struct, IComponent where T3 : struct, IComponent
public interface IForEach<T1, T2, T3, T4> where T1 : struct, IComponent where T2 : struct, IComponent where T3 : struct, IComponent where T4 : struct, IComponent
public interface IForEach<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 IForEach<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 IForEach<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 IForEach<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 IForEach<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.ForEach. Being a struct-constrained generic, calls are devirtualized and usually inlined by the JIT: no delegate, no closure, no allocation. [ForEach] methods 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 IForEach<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(ref T1 c1);

One matching entity: its components, by reference (ref writes them in place).

Edit on GitHub

Last updated on

How is this guide?

On this page