Struct ArchetypeMask256
Compact archetype bitset covering up to 256 archetypes using 4 inline ulongs (32 bytes). Used for Tier 1 query evaluation: a single AND instruction per entity to test archetype membership.
public struct ArchetypeMask256 : IArchetypeMask<ArchetypeMask256>
- Implements
- Inherited Members
Properties
IsEmpty
True if no bits are set.
public readonly bool IsEmpty { get; }
Property Value
MaxId
Maximum archetype ID supported (255).
public int MaxId { get; }
Property Value
PopCount
Number of set bits.
public readonly int PopCount { get; }
Property Value
Methods
And(in ArchetypeMask256)
Bitwise AND — inclusion filtering.
public readonly ArchetypeMask256 And(in ArchetypeMask256 other)
Parameters
otherArchetypeMask256
Returns
AndNot(in ArchetypeMask256)
Bitwise AND NOT — exclusion filtering.
public readonly ArchetypeMask256 AndNot(in ArchetypeMask256 other)
Parameters
otherArchetypeMask256
Returns
Clear(ushort)
Clear the bit for the given archetype ID.
public void Clear(ushort archetypeId)
Parameters
archetypeIdushort
FromArchetype(ushort)
Create a mask with a single archetype bit set.
public static ArchetypeMask256 FromArchetype(ushort archetypeId)
Parameters
archetypeIdushort
Returns
FromSubtree(ushort[])
Create a mask with bits set for all archetype IDs in the subtree.
public static ArchetypeMask256 FromSubtree(ushort[] archetypeIds)
Parameters
archetypeIdsushort[]
Returns
Or(in ArchetypeMask256)
Bitwise OR — union.
public readonly ArchetypeMask256 Or(in ArchetypeMask256 other)
Parameters
otherArchetypeMask256
Returns
Set(ushort)
Set the bit for the given archetype ID.
public void Set(ushort archetypeId)
Parameters
archetypeIdushort
Test(ushort)
Test whether the given archetype ID is set.
public readonly bool Test(ushort archetypeId)
Parameters
archetypeIdushort