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
ComponentType
Gets the component type stored in this array.
Type ComponentType { get; }
Property Value
Count
Gets the number of components stored.
int Count { get; }
Property Value
Methods
AddBoxed(object)
Adds a component from a boxed value.
int AddBoxed(object value)
Parameters
valueobjectThe 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
sourceIndexintThe index in this array.
destinationIComponentArrayThe destination array.
GetBoxed(int)
Gets the boxed component value at the specified index.
object GetBoxed(int index)
Parameters
indexintThe 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
indexintThe index to remove.
SetBoxed(int, object)
Sets the component value at the specified index from a boxed value.
void SetBoxed(int index, object value)