Table of Contents

Class ComponentRegistry

Namespace
KeenEyes
Assembly
KeenEyes.Core.dll

Registry that tracks component types for a specific World. Each World has its own registry, allowing isolated ECS instances.

public sealed class ComponentRegistry : IComponentRegistry
Inheritance
ComponentRegistry
Implements
Inherited Members

Properties

All

All registered component types.

public IReadOnlyList<ComponentInfo> All { get; }

Property Value

IReadOnlyList<ComponentInfo>

Count

Number of registered component types.

public int Count { get; }

Property Value

int

Methods

Get(Type)

Gets the component info for a type, or null if not registered.

public ComponentInfo? Get(Type type)

Parameters

type Type

Returns

ComponentInfo

GetById(ComponentId)

Gets the component info by its ID, or null if the ID is invalid.

public ComponentInfo? GetById(ComponentId id)

Parameters

id ComponentId

The component ID to look up.

Returns

ComponentInfo

The component info, or null if the ID is out of range.

GetOrRegister<T>(bool)

Gets or registers a component type.

public ComponentInfo GetOrRegister<T>(bool isTag = false) where T : struct, IComponent

Parameters

isTag bool

Returns

ComponentInfo

Type Parameters

T

Get<T>()

Gets the component info for a type, or null if not registered.

public ComponentInfo? Get<T>() where T : struct

Returns

ComponentInfo

Type Parameters

T

IsRegistered<T>()

Checks if a component type is registered.

public bool IsRegistered<T>() where T : struct

Returns

bool

Type Parameters

T

Register<T>(bool)

Registers a component type and returns its info. If already registered, returns the existing info.

public ComponentInfo Register<T>(bool isTag = false) where T : struct, IComponent

Parameters

isTag bool

Whether this is a tag component.

Returns

ComponentInfo

The component info for this type.

Type Parameters

T

The component type.