Class EntityFactory
Namespace: ValveResourceFormat.Renderer.Entities
Assembly: Renderer.dll
Creates entities from classnames. Classnames absent from the table are not implemented.
public static class EntityFactoryInheritance
object ← EntityFactory
Remarks
Filled in statically rather than by scanning types, to stay trim-safe and AOT-compatible.
Methods
Create(EntitySystem, EntitySpawnInfo)
Creates the entity for a classname, which the entity system adds to the world to spawn with the rest of its spawn group. An unimplemented classname gives a GenericModelEntity when it has a model, otherwise a GenericEntity.
public static BaseEntity? Create(EntitySystem system, EntitySpawnInfo spawnInfo)Parameters
system EntitySystem
spawnInfo EntitySpawnInfo
Returns
The entity, or null when the keyvalues name no classname or a worldspawn.
Register<T>(string, EntityCreator)
Registers a classname and builds its entity class's table of EntityInputAttribute handlers. Safe to call while maps are loading.
public static void Register<T>(string classname, EntityCreator creator) where T : BaseEntityParameters
classname string
The classname to link, matched case-insensitively.
creator EntityCreator
Constructs the entity.
Type Parameters
T
The entity class the classname spawns.

