Class EntityRecordAccessor
Static accessor for entity records stored as raw bytes in the per-archetype RawValueHashMap. Record layout: [EntityRecordHeader (14B)] [Location₀ (4B)] [Location₁ (4B)] ... [Location_{N-1} (4B)]
public static class EntityRecordAccessor
- Inheritance
-
EntityRecordAccessor
- Inherited Members
Fields
HeaderSize
Size of the EntityRecordHeader in bytes.
public const int HeaderSize = 14
Field Value
MaxComponentCount
Maximum component count per archetype (16-bit EnabledBits).
public const int MaxComponentCount = 16
Field Value
MaxRecordSize
Maximum entity record size in bytes: HeaderSize + MaxComponentCount × 4 = 78.
public const int MaxRecordSize = 78
Field Value
Methods
CopyLocations(byte*, byte*, int)
Bulk copy all component locations from one record to another.
public static void CopyLocations(byte* src, byte* dst, int componentCount)
Parameters
GetHeader(byte*)
Get a reference to the header at the start of the record.
public static ref EntityRecordHeader GetHeader(byte* record)
Parameters
recordbyte*
Returns
GetLocation(byte*, int)
Read the component chunk ID at the given slot index.
public static int GetLocation(byte* record, int slot)
Parameters
Returns
InitializeRecord(byte*, int)
Zero-initialize an entire entity record (header + locations).
public static void InitializeRecord(byte* record, int componentCount)
Parameters
RecordSize(int)
Total entity record size for an archetype with componentCount components.
public static int RecordSize(int componentCount)
Parameters
componentCountint
Returns
SetLocation(byte*, int, int)
Write the component chunk ID at the given slot index.
public static void SetLocation(byte* record, int slot, int chunkId)