Class SpawnGroupManager
Namespace: ValveResourceFormat.Renderer.World
Assembly: Renderer.dll
Loads, spawns and unloads the SpawnGroups of an EntitySystem, and tells their listeners about it.
public sealed class SpawnGroupManagerInheritance
object ← SpawnGroupManager
Remarks
Spawn groups are not part of the entity system: the engine loads them, and a server game system keeps what the game needs of each. The entity system only creates and spawns their entities and holds the active group.
Nothing that draws knows spawn groups either. A group with SpawnGroup.HasOwnScene hands its scene to the SpawnGroupManager.Host once it spawns, which draws the scene with the other scenes of the world group. Unloading the group removes the scene from the host.
Properties
Groups
Gets the loaded spawn groups, in load order.
public IReadOnlyList<SpawnGroup> Groups { get; }Property Value
Host
Gets or sets the host that draws the scenes of the groups with a scene of their own.
public ISceneHost? Host { get; set; }Property Value
Methods
AddChildSpawnGroup(SpawnGroup, SpawnGroup)
Makes a loaded spawn group a child of another. Unloading the parent unloads the child.
public void AddChildSpawnGroup(SpawnGroup parent, SpawnGroup child)Parameters
parent SpawnGroup
The group to unload the child with.
child SpawnGroup
The group to unload with the parent.
FindSpawnGroupByWorldName(string)
Finds a spawned group by the world it spawns from, comparing the names as paths.
public SpawnGroup? FindSpawnGroupByWorldName(string worldName)Parameters
worldName string
The world, such as maps/stages/lms_stage1.
Returns
The first group loaded from it, or null.
ListenForSpawnGroupToFinish(SpawnGroup, Action<IReadOnlyList<BaseEntity>>)
Calls back once a loaded spawn group has spawned, with the entities it spawned.
public void ListenForSpawnGroupToFinish(SpawnGroup group, Action<IReadOnlyList<BaseEntity>> onFinished)Parameters
group SpawnGroup
The group to wait for.
onFinished Action<IReadOnlyList<BaseEntity>>
Called with the entities spawned, in the order the listeners were added.
LoadSpawnGroup(SpawnGroup)
Loads a spawn group as its loader described it. Nothing of it spawns until SpawnGroupManager.SynchronouslySpawnGroup(SpawnGroup) is called, or the next tick otherwise.
public void LoadSpawnGroup(SpawnGroup group)Parameters
group SpawnGroup
The group to load, which loads only once.
PerformActivateSpawnGroup(SpawnGroup)
Makes a loaded spawn group the active one. A point_template set to insert into the active group adds its entities to that group.
public void PerformActivateSpawnGroup(SpawnGroup group)Parameters
group SpawnGroup
The group to activate.
SynchronouslySpawnGroup(SpawnGroup)
Spawns a loaded spawn group there and then, rather than on the next tick. The group gets its world first, see SpawnGroupManager.AcquireWorld, then its entities spawn from it.
public void SynchronouslySpawnGroup(SpawnGroup group)Parameters
group SpawnGroup
The group to spawn. Nothing happens if it is not loaded or has spawned.
UnloadSpawnGroup(SpawnGroup)
Unloads a spawn group: its children first, then every entity it owns, then its scene and collision when it has a scene of its own.
public void UnloadSpawnGroup(SpawnGroup group)Parameters
group SpawnGroup
The group to unload. Nothing happens if it is not loaded.

