Table of Contents

Class EntityTypesMap

Namespace
LiteEntitySystem
Assembly
LiteEntitySystem.dll
public abstract class EntityTypesMap
Inheritance
object
EntityTypesMap
Derived

Fields

MaxId

Maximum registered id. Ids start with 1 Modify only in case when you know what you doing

public ushort MaxId

Field Value

ushort

RegisteredTypes

Currently registered types Modify only in case when you know what you doing

public readonly Dictionary<Type, RegisteredTypeInfo> RegisteredTypes

Field Value

Dictionary<Type, RegisteredTypeInfo>

Methods

RegisterType(Type, ushort, string, EntityConstructor<InternalEntity>)

Register entity type known only at runtime with explicit class id

protected void RegisterType(Type entityType, ushort classId, string className, EntityConstructor<InternalEntity> constructor)

Parameters

entityType Type

Type of entity, must derive from InternalEntity

classId ushort

Class id, must be greater than 0 and unique within map

className string

Class name used in logs and debug

constructor EntityConstructor<InternalEntity>

Constructor of entity, must create instances of entityType

RegisterType<TEntity>(ushort, string, EntityConstructor<TEntity>)

Register entity type with explicit class id (for maps that are not driven by enum)

protected void RegisterType<TEntity>(ushort classId, string className, EntityConstructor<TEntity> constructor) where TEntity : InternalEntity

Parameters

classId ushort

Class id, must be greater than 0 and unique within map

className string

Class name used in logs and debug

constructor EntityConstructor<TEntity>

Constructor of entity

Type Parameters

TEntity

Type of entity