Table of Contents

Struct ArchetypeMaskLarge

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

Large archetype bitset for >256 archetypes, backed by a ulong[] array. Same API as ArchetypeMask256 but supports up to 4096 archetypes.

public struct ArchetypeMaskLarge : IArchetypeMask<ArchetypeMaskLarge>
Implements
Inherited Members

Constructors

ArchetypeMaskLarge(int)

Create a mask sized for the given maximum archetype ID.

public ArchetypeMaskLarge(int maxArchetypeId)

Parameters

maxArchetypeId int

Properties

IsEmpty

True if no bits are set.

public readonly bool IsEmpty { get; }

Property Value

bool

MaxId

Maximum archetype ID supported by this mask instance.

public int MaxId { get; }

Property Value

int

PopCount

Number of set bits.

public readonly int PopCount { get; }

Property Value

int

Methods

And(in ArchetypeMaskLarge)

Bitwise AND — inclusion filtering.

public readonly ArchetypeMaskLarge And(in ArchetypeMaskLarge other)

Parameters

other ArchetypeMaskLarge

Returns

ArchetypeMaskLarge

AndNot(in ArchetypeMaskLarge)

Bitwise AND NOT — exclusion filtering.

public readonly ArchetypeMaskLarge AndNot(in ArchetypeMaskLarge other)

Parameters

other ArchetypeMaskLarge

Returns

ArchetypeMaskLarge

Clear(ushort)

Clear the bit for the given archetype ID.

public void Clear(ushort archetypeId)

Parameters

archetypeId ushort

FromArchetype(ushort, int)

Create a mask with a single archetype bit set.

public static ArchetypeMaskLarge FromArchetype(ushort archetypeId, int maxArchetypeId)

Parameters

archetypeId ushort
maxArchetypeId int

Returns

ArchetypeMaskLarge

FromSubtree(ushort[], int)

Create a mask with bits set for all archetype IDs in the subtree.

public static ArchetypeMaskLarge FromSubtree(ushort[] archetypeIds, int maxArchetypeId)

Parameters

archetypeIds ushort[]
maxArchetypeId int

Returns

ArchetypeMaskLarge

Or(in ArchetypeMaskLarge)

Bitwise OR — union.

public readonly ArchetypeMaskLarge Or(in ArchetypeMaskLarge other)

Parameters

other ArchetypeMaskLarge

Returns

ArchetypeMaskLarge

Set(ushort)

Set the bit for the given archetype ID.

public void Set(ushort archetypeId)

Parameters

archetypeId ushort

Test(ushort)

Test whether the given archetype ID is set.

public readonly bool Test(ushort archetypeId)

Parameters

archetypeId ushort

Returns

bool