Barotrauma Server
Loading...
Searching...
No Matches
Barotrauma.Entity Class Referenceabstract
Inheritance diagram for Barotrauma.Entity:
Barotrauma.ISpatialEntity Barotrauma.Character Barotrauma.EntitySpawner Barotrauma.EntitySpawner Barotrauma.Level Barotrauma.Level Barotrauma.LevelObjectManager Barotrauma.MapEntity Barotrauma.Networking.RespawnManager Barotrauma.Networking.RespawnManager Barotrauma.Submarine

Public Member Functions

 Entity (Submarine submarine, ushort id)
 
void FreeID ()
 Removes the entity from the entity dictionary and frees up the ID it was using.
 
virtual void Remove ()
 

Static Public Member Functions

static IReadOnlyCollection< EntityGetEntities ()
 
static int FindFreeIdBlock (int minBlockSize)
 Finds a contiguous block of free IDs of at least the given size.
 
static Entity FindEntityByID (ushort ID)
 Find an entity based on the ID.
 
static void RemoveAll ()
 
static void DumpIds (int count, string filename)
 

Public Attributes

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.
 
readonly string CreationStackTrace
 
readonly UInt64 CreationIndex
 

Static Public Attributes

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

virtual ushort DetermineID (ushort id, Submarine submarine)
 

Protected Attributes

AITarget aiTarget
 

Properties

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]
 Indetectable characters can't be spotted by AIs and aren't visible on the sonar or health scanner.
 
double SpawnTime [get]
 
string ErrorLine [get]
 
- Properties inherited from Barotrauma.ISpatialEntity

Constructor & Destructor Documentation

◆ Entity()

Barotrauma.Entity.Entity ( Submarine submarine,
ushort id )

Member Function Documentation

◆ DetermineID()

virtual ushort Barotrauma.Entity.DetermineID ( ushort id,
Submarine submarine )
protectedvirtual

Reimplemented in Barotrauma.Submarine.

◆ DumpIds()

static void Barotrauma.Entity.DumpIds ( int count,
string filename )
static

◆ FindEntityByID()

static Entity Barotrauma.Entity.FindEntityByID ( ushort ID)
static

Find an entity based on the ID.

◆ FindFreeIdBlock()

static int Barotrauma.Entity.FindFreeIdBlock ( int minBlockSize)
static

Finds a contiguous block of free IDs of at least the given size.

Returns
The first ID in the found block, or zero if none are found

◆ FreeID()

void Barotrauma.Entity.FreeID ( )

Removes the entity from the entity dictionary and frees up the ID it was using.

◆ GetEntities()

static IReadOnlyCollection< Entity > Barotrauma.Entity.GetEntities ( )
static

◆ Remove()

◆ RemoveAll()

static void Barotrauma.Entity.RemoveAll ( )
static

Member Data Documentation

◆ aiTarget

AITarget Barotrauma.Entity.aiTarget
protected

◆ CreationIndex

readonly UInt64 Barotrauma.Entity.CreationIndex

◆ CreationStackTrace

readonly string Barotrauma.Entity.CreationStackTrace

◆ DummyID

const ushort Barotrauma.Entity.DummyID = ushort.MaxValue - 2
static

◆ EntitySpawnerID

const ushort Barotrauma.Entity.EntitySpawnerID = ushort.MaxValue
static

◆ ID

readonly ushort Barotrauma.Entity.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.

◆ MaxEntityCount

const ushort Barotrauma.Entity.MaxEntityCount = ushort.MaxValue - 4
static

◆ NullEntityID

const ushort Barotrauma.Entity.NullEntityID = 0
static

◆ ReservedIDStart

const ushort Barotrauma.Entity.ReservedIDStart = ushort.MaxValue - 3
static

◆ RespawnManagerID

const ushort Barotrauma.Entity.RespawnManagerID = ushort.MaxValue - 1
static

◆ Spawner

EntitySpawner Barotrauma.Entity.Spawner
static

Property Documentation

◆ AiTarget

AITarget Barotrauma.Entity.AiTarget
get

◆ DrawPosition

virtual Vector2 Barotrauma.Entity.DrawPosition
get

◆ EntityCount

int Barotrauma.Entity.EntityCount
staticget

◆ ErrorLine

string Barotrauma.Entity.ErrorLine
get

◆ IdFreed

bool Barotrauma.Entity.IdFreed
get

◆ InDetectable

bool Barotrauma.Entity.InDetectable
getset

Indetectable characters can't be spotted by AIs and aren't visible on the sonar or health scanner.

◆ Position

virtual Vector2 Barotrauma.Entity.Position
get

◆ Removed

bool Barotrauma.Entity.Removed
get

◆ SimPosition

virtual Vector2 Barotrauma.Entity.SimPosition
get

◆ SpawnTime

double Barotrauma.Entity.SpawnTime
get

◆ Submarine

Submarine Barotrauma.Entity.Submarine
getset

◆ WorldPosition

virtual Vector2 Barotrauma.Entity.WorldPosition
get

The documentation for this class was generated from the following file: