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
Count
Number of registered component types.
public int Count { get; }
Property Value
Methods
Get(Type)
Gets the component info for a type, or null if not registered.
public ComponentInfo? Get(Type type)
Parameters
typeType
Returns
GetById(ComponentId)
Gets the component info by its ID, or null if the ID is invalid.
public ComponentInfo? GetById(ComponentId id)
Parameters
idComponentIdThe 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
isTagbool
Returns
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
Type Parameters
T
IsRegistered<T>()
Checks if a component type is registered.
public bool IsRegistered<T>() where T : struct
Returns
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
isTagboolWhether this is a tag component.
Returns
- ComponentInfo
The component info for this type.
Type Parameters
TThe component type.