Skip to content

EntityPairSet

namespace Griff.Runtime;
public sealed class EntityPairSet

Pairs of entities, each pair once, in the order they were first added: who touched what in a frame’s physics (see Touches) and which triggers have what in them (TriggerPairs). Whatever goes by them (which of two collectors gets a pickup, which trigger hears of something first) goes the same way every time, after a rewind too, rather than in a hash set’s order.

public int Count { get; }

How many pairs there are.

public bool Add(ValueTuple<Entity, Entity> pair)

Adds a pair, after the others; false if it’s there already.

public void Clear()

Forgets every pair.

public bool Contains(ValueTuple<Entity, Entity> pair)

True if pair touched.

public void EnsureCapacity(int capacity)

Makes room for capacity pairs, so adding them makes no garbage.

public List<T>.Enumerator GetEnumerator()

The pairs, in the order they were added.