Class EntityTypesMap
- Namespace
- LiteEntitySystem
- Assembly
- LiteEntitySystem.dll
public abstract class EntityTypesMap
- Inheritance
-
objectEntityTypesMap
- 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
RegisteredTypes
Currently registered types Modify only in case when you know what you doing
public readonly Dictionary<Type, RegisteredTypeInfo> RegisteredTypes
Field Value
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
entityTypeTypeType of entity, must derive from InternalEntity
classIdushortClass id, must be greater than 0 and unique within map
classNamestringClass name used in logs and debug
constructorEntityConstructor<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
classIdushortClass id, must be greater than 0 and unique within map
classNamestringClass name used in logs and debug
constructorEntityConstructor<TEntity>Constructor of entity
Type Parameters
TEntityType of entity