Class EntitySpawnCollection
Inheritance
System.Object
EntitySpawnCollection
Namespace: Content.Shared.Storage
Assembly: Content.Shared.dll
Syntax
public static class EntitySpawnCollection : object
Methods
| Improve this Doc View SourceCollectOrGroups(IEnumerable<EntitySpawnEntry>, out List<EntitySpawnCollection.OrGroup>)
Collects all entries that belong together in an OrGroup, and then returns the leftover ungrouped entries.
Declaration
public static List<EntitySpawnEntry> CollectOrGroups(IEnumerable<EntitySpawnEntry> entries, out List<EntitySpawnCollection.OrGroup> orGroups)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<EntitySpawnEntry> | entries | A list of entries that will be collected into OrGroups. |
List<EntitySpawnCollection.OrGroup> | orGroups | A list of entries collected into OrGroups. |
Returns
Type | Description |
---|---|
List<EntitySpawnEntry> | A list of entries that are not in an OrGroup. |
GetAmount(EntitySpawnEntry, IRobustRandom, Boolean)
Declaration
public static double GetAmount(this EntitySpawnEntry entry, IRobustRandom random = null, bool getAverage = false)
Parameters
Type | Name | Description |
---|---|---|
EntitySpawnEntry | entry | |
Robust.Shared.Random.IRobustRandom | random | |
System.Boolean | getAverage |
Returns
Type | Description |
---|---|
System.Double |
GetAmount(EntitySpawnEntry, Random, Boolean)
Declaration
public static double GetAmount(this EntitySpawnEntry entry, Random random, bool getAverage = false)
Parameters
Type | Name | Description |
---|---|---|
EntitySpawnEntry | entry | |
System.Random | random | |
System.Boolean | getAverage |
Returns
Type | Description |
---|---|
System.Double |
GetSpawns(IEnumerable<EntitySpawnEntry>, IRobustRandom)
Using a collection of entity spawn entries, picks a random list of entity prototypes to spawn from that collection.
Declaration
public static List<string?> GetSpawns(IEnumerable<EntitySpawnEntry> entries, IRobustRandom random = null)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<EntitySpawnEntry> | entries | The entity spawn entries. |
Robust.Shared.Random.IRobustRandom | random | Resolve param. |
Returns
Type | Description |
---|---|
List<System.Nullable<System.String>> | A list of entity prototypes that should be spawned. |
Remarks
This does not spawn the entities. The caller is responsible for doing so, since it may want to do something special to those entities (offset them, insert them into storage, etc)
GetSpawns(IEnumerable<EntitySpawnEntry>, Random)
Declaration
public static List<string?> GetSpawns(IEnumerable<EntitySpawnEntry> entries, Random random)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<EntitySpawnEntry> | entries | |
System.Random | random |
Returns
Type | Description |
---|---|
List<System.Nullable<System.String>> |