Barotrauma Client Doc
Barotrauma.Entity Class Reference
Inheritance diagram for Barotrauma.Entity:
Barotrauma.ISpatialEntity Barotrauma.Character Barotrauma.EntitySpawner Barotrauma.EntitySpawner Barotrauma.Level Barotrauma.LevelObjectManager Barotrauma.MapEntity Barotrauma.MapEntity Barotrauma.Networking.RespawnManager Barotrauma.Submarine 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. More...
 
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 More...
 
static Entity FindEntityByID (ushort ID)
 Find an entity based on the ID More...
 
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. More...
 
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]
 
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

Definition at line 12 of file Entity.cs.

Constructor & Destructor Documentation

◆ Entity()

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

Definition at line 87 of file Entity.cs.

Member Function Documentation

◆ DetermineID()

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

Reimplemented in Barotrauma.Submarine.

Definition at line 150 of file Entity.cs.

◆ DumpIds()

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

Definition at line 331 of file Entity.cs.

◆ FindEntityByID()

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

Find an entity based on the ID

Definition at line 201 of file Entity.cs.

◆ 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

Definition at line 177 of file Entity.cs.

◆ FreeID()

void Barotrauma.Entity.FreeID ( )

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

Definition at line 299 of file Entity.cs.

◆ GetEntities()

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

Definition at line 24 of file Entity.cs.

◆ Remove()

◆ RemoveAll()

static void Barotrauma.Entity.RemoveAll ( )
static

Definition at line 209 of file Entity.cs.

Member Data Documentation

◆ aiTarget

AITarget Barotrauma.Entity.aiTarget
protected

Definition at line 33 of file Entity.cs.

◆ CreationIndex

readonly UInt64 Barotrauma.Entity.CreationIndex

Definition at line 83 of file Entity.cs.

◆ CreationStackTrace

readonly string Barotrauma.Entity.CreationStackTrace

Definition at line 82 of file Entity.cs.

◆ DummyID

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

Definition at line 17 of file Entity.cs.

◆ EntitySpawnerID

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

Definition at line 15 of file Entity.cs.

◆ 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.

Definition at line 43 of file Entity.cs.

◆ MaxEntityCount

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

Definition at line 21 of file Entity.cs.

◆ NullEntityID

const ushort Barotrauma.Entity.NullEntityID = 0
static

Definition at line 14 of file Entity.cs.

◆ ReservedIDStart

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

Definition at line 19 of file Entity.cs.

◆ RespawnManagerID

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

Definition at line 16 of file Entity.cs.

◆ Spawner

EntitySpawner Barotrauma.Entity.Spawner
static

Definition at line 31 of file Entity.cs.

Property Documentation

◆ AiTarget

AITarget Barotrauma.Entity.AiTarget
get

Definition at line 55 of file Entity.cs.

◆ DrawPosition

virtual Vector2 Barotrauma.Entity.DrawPosition
get

Definition at line 51 of file Entity.cs.

◆ EntityCount

int Barotrauma.Entity.EntityCount
staticget

Definition at line 29 of file Entity.cs.

◆ ErrorLine

string Barotrauma.Entity.ErrorLine
get

Definition at line 84 of file Entity.cs.

◆ IdFreed

bool Barotrauma.Entity.IdFreed
get

Definition at line 37 of file Entity.cs.

◆ InDetectable

bool Barotrauma.Entity.InDetectable
getset

Definition at line 57 of file Entity.cs.

◆ Position

virtual Vector2 Barotrauma.Entity.Position
get

Definition at line 47 of file Entity.cs.

◆ Removed

bool Barotrauma.Entity.Removed
get

Definition at line 35 of file Entity.cs.

◆ SimPosition

virtual Vector2 Barotrauma.Entity.SimPosition
get

Definition at line 45 of file Entity.cs.

◆ SpawnTime

double Barotrauma.Entity.SpawnTime
get

Definition at line 76 of file Entity.cs.

◆ Submarine

Submarine Barotrauma.Entity.Submarine
getset

Definition at line 53 of file Entity.cs.

◆ WorldPosition

virtual Vector2 Barotrauma.Entity.WorldPosition
get

Definition at line 49 of file Entity.cs.