Table of Contents

Interface IComponentArray

Namespace
KeenEyes
Assembly
KeenEyes.Core.dll

Non-generic interface for component storage within an archetype. Enables heterogeneous collection of typed component arrays.

public interface IComponentArray

Properties

Capacity

Gets the capacity of the array.

int Capacity { get; }

Property Value

int

ComponentType

Gets the component type stored in this array.

Type ComponentType { get; }

Property Value

Type

Count

Gets the number of components stored.

int Count { get; }

Property Value

int

Methods

AddBoxed(object)

Adds a component from a boxed value.

int AddBoxed(object value)

Parameters

value object

The boxed component value to add.

Returns

int

The index where the component was added.

Clear()

Clears all components from this array.

void Clear()

CopyTo(int, IComponentArray)

Copies a component from this array to another array. Used during entity migration between archetypes.

void CopyTo(int sourceIndex, IComponentArray destination)

Parameters

sourceIndex int

The index in this array.

destination IComponentArray

The destination array.

GetBoxed(int)

Gets the boxed component value at the specified index.

object GetBoxed(int index)

Parameters

index int

The index of the component.

Returns

object

The boxed component value.

Remarks

This method boxes the component and should only be used for debugging or serialization scenarios. For performance-critical code, use the typed GetRef(int) method.

RemoveAtSwapBack(int)

Removes the component at the specified index by swapping with the last element.

void RemoveAtSwapBack(int index)

Parameters

index int

The index to remove.

SetBoxed(int, object)

Sets the component value at the specified index from a boxed value.

void SetBoxed(int index, object value)

Parameters

index int

The index of the component.

value object

The boxed component value.