Barotrauma Client Doc
Barotrauma.EntitySpawner Class Reference
Inheritance diagram for Barotrauma.EntitySpawner:
Barotrauma.Entity Barotrauma.Networking.IServerSerializable Barotrauma.Entity Barotrauma.Networking.IServerSerializable Barotrauma.ISpatialEntity Barotrauma.Networking.INetSerializable Barotrauma.ISpatialEntity Barotrauma.Networking.INetSerializable

Classes

interface  IEntitySpawnInfo
 
class  ItemSpawnInfo
 
class  RemoveEntity
 
class  SpawnEntity
 
class  SpawnOrRemove
 

Public Member Functions

 EntitySpawner ()
 
override string ToString ()
 
void AddItemToSpawnQueue (ItemPrefab itemPrefab, Vector2 worldPosition, float? condition=null, int? quality=null, Action< Item > onSpawned=null)
 
void AddItemToSpawnQueue (ItemPrefab itemPrefab, Vector2 position, Submarine sub, float? condition=null, int? quality=null, Action< Item > onSpawned=null)
 
void AddItemToSpawnQueue (ItemPrefab itemPrefab, Inventory inventory, float? condition=null, int? quality=null, Action< Item > onSpawned=null, bool spawnIfInventoryFull=true, bool ignoreLimbSlots=false, InvSlotType slot=InvSlotType.None)
 
void AddCharacterToSpawnQueue (Identifier speciesName, Vector2 worldPosition, Action< Character > onSpawn=null)
 
void AddCharacterToSpawnQueue (Identifier speciesName, Vector2 position, Submarine sub, Action< Character > onSpawn=null)
 
void AddCharacterToSpawnQueue (Identifier speciesName, Vector2 worldPosition, CharacterInfo characterInfo, Action< Character > onSpawn=null)
 
void AddEntityToRemoveQueue (Entity entity)
 
void AddItemToRemoveQueue (Item item)
 
bool IsInSpawnQueue (Predicate< IEntitySpawnInfo > predicate)
 Are there any entities in the spawn queue that match the given predicate More...
 
int CountSpawnQueue (Predicate< IEntitySpawnInfo > predicate)
 How many entities in the spawn queue match the given predicate More...
 
bool IsInRemoveQueue (Entity entity)
 
void Update (bool createNetworkEvents=true)
 
void Reset ()
 
void ClientEventRead (IReadMessage message, float sendingTime)
 
- Public Member Functions inherited from Barotrauma.Entity
 Entity (Submarine submarine, ushort id)
 
void FreeID ()
 Removes the entity from the entity dictionary and frees up the ID it was using. More...
 
virtual void Remove ()
 

Public Attributes

readonly List<(Entity entity, bool isRemoval)> receivedEvents = new List<(Entity entity, bool isRemoval)>()
 
- Public Attributes inherited from Barotrauma.Entity
readonly ushort ID
 Unique, but non-persistent identifier. Stays the same if the entities are created in the exactly same order, but doesn't persist e.g. between the rounds. More...
 
readonly string CreationStackTrace
 
readonly UInt64 CreationIndex
 

Additional Inherited Members

- Static Public Member Functions inherited from Barotrauma.Entity
static IReadOnlyCollection< EntityGetEntities ()
 
static int FindFreeIdBlock (int minBlockSize)
 Finds a contiguous block of free IDs of at least the given size More...
 
static Entity FindEntityByID (ushort ID)
 Find an entity based on the ID More...
 
static void RemoveAll ()
 
static void DumpIds (int count, string filename)
 
- Static Public Attributes inherited from Barotrauma.Entity
const ushort NullEntityID = 0
 
const ushort EntitySpawnerID = ushort.MaxValue
 
const ushort RespawnManagerID = ushort.MaxValue - 1
 
const ushort DummyID = ushort.MaxValue - 2
 
const ushort ReservedIDStart = ushort.MaxValue - 3
 
const ushort MaxEntityCount = ushort.MaxValue - 4
 
static EntitySpawner Spawner
 
- Protected Member Functions inherited from Barotrauma.Entity
virtual ushort DetermineID (ushort id, Submarine submarine)
 
- Protected Attributes inherited from Barotrauma.Entity
AITarget aiTarget
 
- Properties inherited from Barotrauma.Entity
static int EntityCount [get]
 
bool Removed [get]
 
bool IdFreed [get]
 
virtual Vector2 SimPosition [get]
 
virtual Vector2 Position [get]
 
virtual Vector2 WorldPosition [get]
 
virtual Vector2 DrawPosition [get]
 
Submarine Submarine [get, set]
 
AITarget AiTarget [get]
 
bool InDetectable [get, set]
 
double SpawnTime [get]
 
string ErrorLine [get]
 
- Properties inherited from Barotrauma.ISpatialEntity
Vector2 Position [get]
 
Vector2 WorldPosition [get]
 
Vector2 SimPosition [get]
 
Submarine Submarine [get]
 

Detailed Description

Constructor & Destructor Documentation

◆ EntitySpawner()

Barotrauma.EntitySpawner.EntitySpawner ( )

Member Function Documentation

◆ AddCharacterToSpawnQueue() [1/3]

void Barotrauma.EntitySpawner.AddCharacterToSpawnQueue ( Identifier  speciesName,
Vector2  position,
Submarine  sub,
Action< Character onSpawn = null 
)

◆ AddCharacterToSpawnQueue() [2/3]

void Barotrauma.EntitySpawner.AddCharacterToSpawnQueue ( Identifier  speciesName,
Vector2  worldPosition,
Action< Character onSpawn = null 
)

◆ AddCharacterToSpawnQueue() [3/3]

void Barotrauma.EntitySpawner.AddCharacterToSpawnQueue ( Identifier  speciesName,
Vector2  worldPosition,
CharacterInfo  characterInfo,
Action< Character onSpawn = null 
)

◆ AddEntityToRemoveQueue()

void Barotrauma.EntitySpawner.AddEntityToRemoveQueue ( Entity  entity)

◆ AddItemToRemoveQueue()

void Barotrauma.EntitySpawner.AddItemToRemoveQueue ( Item  item)

◆ AddItemToSpawnQueue() [1/3]

void Barotrauma.EntitySpawner.AddItemToSpawnQueue ( ItemPrefab  itemPrefab,
Inventory  inventory,
float?  condition = null,
int?  quality = null,
Action< Item onSpawned = null,
bool  spawnIfInventoryFull = true,
bool  ignoreLimbSlots = false,
InvSlotType  slot = InvSlotType.None 
)

◆ AddItemToSpawnQueue() [2/3]

void Barotrauma.EntitySpawner.AddItemToSpawnQueue ( ItemPrefab  itemPrefab,
Vector2  position,
Submarine  sub,
float?  condition = null,
int?  quality = null,
Action< Item onSpawned = null 
)

◆ AddItemToSpawnQueue() [3/3]

void Barotrauma.EntitySpawner.AddItemToSpawnQueue ( ItemPrefab  itemPrefab,
Vector2  worldPosition,
float?  condition = null,
int?  quality = null,
Action< Item onSpawned = null 
)

◆ ClientEventRead()

void Barotrauma.EntitySpawner.ClientEventRead ( IReadMessage  message,
float  sendingTime 
)

◆ CountSpawnQueue()

int Barotrauma.EntitySpawner.CountSpawnQueue ( Predicate< IEntitySpawnInfo predicate)

How many entities in the spawn queue match the given predicate

Definition at line 399 of file BarotraumaShared/SharedSource/Networking/EntitySpawner.cs.

◆ IsInRemoveQueue()

bool Barotrauma.EntitySpawner.IsInRemoveQueue ( Entity  entity)

◆ IsInSpawnQueue()

bool Barotrauma.EntitySpawner.IsInSpawnQueue ( Predicate< IEntitySpawnInfo predicate)

Are there any entities in the spawn queue that match the given predicate

Definition at line 387 of file BarotraumaShared/SharedSource/Networking/EntitySpawner.cs.

◆ Reset()

void Barotrauma.EntitySpawner.Reset ( )

◆ ToString()

override string Barotrauma.EntitySpawner.ToString ( )

◆ Update()

void Barotrauma.EntitySpawner.Update ( bool  createNetworkEvents = true)

Member Data Documentation

◆ receivedEvents

readonly List<(Entity entity, bool isRemoval)> Barotrauma.EntitySpawner.receivedEvents = new List<(Entity entity, bool isRemoval)>()