Skip to content

Class ComponentInfo

Namespace: Apogee.Reflection
Assembly: Apogee.Reflection.dll

An ECS component: its memory layout, so that the ECS can register it and scripts can read and write it.

public sealed class ComponentInfo

Inheritance

object ← ComponentInfo

Inherited Members

object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Constructors

ComponentInfo(string, Type?, int, int, IReadOnlyList<FieldDef>, string?)

public ComponentInfo(string name, Type? clrType, int size, int alignment, IReadOnlyList<FieldDef> fields, string? doc = null)

Parameters

name string

clrType Type?

size int

alignment int

fields IReadOnlyList<FieldDef>

doc string?

Properties

Alignment

public int Alignment { get; }

Property Value

int

ClrType

The struct, or null for a component a script defined.

public Type? ClrType { get; }

Property Value

Type?

Doc

public string? Doc { get; }

Property Value

string?

Fields

public IReadOnlyList<FieldDef> Fields { get; }

Property Value

IReadOnlyList<FieldDef>

IsTag

public bool IsTag { get; }

Property Value

bool

Name

The script name: the C# name, in PascalCase as ECS component names are.

public string Name { get; }

Property Value

string

Size

Zero for a tag.

public int Size { get; }

Property Value

int

Methods

FindField(string)

public FieldDef? FindField(string name)

Parameters

name string

Returns

FieldDef?