Table of Contents

Class EntityRecordAccessor

Namespace
Typhon.Engine
Assembly
Typhon.Engine.dll

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

int

MaxComponentCount

Maximum component count per archetype (16-bit EnabledBits).

public const int MaxComponentCount = 16

Field Value

int

MaxRecordSize

Maximum entity record size in bytes: HeaderSize + MaxComponentCount × 4 = 78.

public const int MaxRecordSize = 78

Field Value

int

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

src byte*
dst byte*
componentCount int

GetHeader(byte*)

Get a reference to the header at the start of the record.

public static ref EntityRecordHeader GetHeader(byte* record)

Parameters

record byte*

Returns

EntityRecordHeader

GetLocation(byte*, int)

Read the component chunk ID at the given slot index.

public static int GetLocation(byte* record, int slot)

Parameters

record byte*
slot int

Returns

int

InitializeRecord(byte*, int)

Zero-initialize an entire entity record (header + locations).

public static void InitializeRecord(byte* record, int componentCount)

Parameters

record byte*
componentCount int

RecordSize(int)

Total entity record size for an archetype with componentCount components.

public static int RecordSize(int componentCount)

Parameters

componentCount int

Returns

int

SetLocation(byte*, int, int)

Write the component chunk ID at the given slot index.

public static void SetLocation(byte* record, int slot, int chunkId)

Parameters

record byte*
slot int
chunkId int