Barotrauma Server Doc
Barotrauma.LevelObject Class Reference
Inheritance diagram for Barotrauma.LevelObject:
Barotrauma.ISpatialEntity Barotrauma.IDamageable Barotrauma.ISerializableEntity

Public Member Functions

 LevelObject (LevelObjectPrefab prefab, Vector3 position, float scale, float rotation=0.0f)
 
AttackResult AddDamage (Character attacker, Vector2 worldPosition, Attack attack, Vector2 impulseDirection, float deltaTime, bool playSound=true)
 
void AddDamage (float damage, float deltaTime, Entity attacker, bool isNetworkEvent=false)
 
Vector2 LocalToWorld (Vector2 localPosition, float swingState=0.0f)
 
void Remove ()
 
override string ToString ()
 
void ServerWrite (IWriteMessage msg, Client c)
 

Public Attributes

readonly LevelObjectPrefab Prefab
 
Vector3 Position
 
float NetworkUpdateTimer
 
float Scale
 
float Rotation
 
LevelObjectPrefab ActivePrefab
 
Level.Cave ParentCave
 

Protected Attributes

bool tookDamage
 

Properties

PhysicsBody PhysicsBody [get]
 
List< LevelTriggerTriggers [get]
 
bool NeedsNetworkSyncing [get, set]
 
bool NeedsUpdate [get]
 
float Health [get]
 
Sprite??? Sprite [get]
 
Vector2 WorldPosition [get]
 
Vector2 SimPosition [get]
 
Submarine Submarine [get]
 
string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties = new Dictionary<Identifier, SerializableProperty>() [get]
 
- Properties inherited from Barotrauma.ISpatialEntity
Vector2 Position [get]
 
Vector2 WorldPosition [get]
 
Vector2 SimPosition [get]
 
Submarine Submarine [get]
 
- Properties inherited from Barotrauma.IDamageable
Vector2 SimPosition [get]
 
Vector2 WorldPosition [get]
 
float Health [get]
 
- Properties inherited from Barotrauma.ISerializableEntity
string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 

Detailed Description

Definition at line 11 of file LevelObject.cs.

Constructor & Destructor Documentation

◆ LevelObject()

Barotrauma.LevelObject.LevelObject ( LevelObjectPrefab  prefab,
Vector3  position,
float  scale,
float  rotation = 0.0f 
)

Definition at line 88 of file LevelObject.cs.

Member Function Documentation

◆ AddDamage() [1/2]

AttackResult Barotrauma.LevelObject.AddDamage ( Character  attacker,
Vector2  worldPosition,
Attack  attack,
Vector2  impulseDirection,
float  deltaTime,
bool  playSound = true 
)

Implements Barotrauma.IDamageable.

Definition at line 163 of file LevelObject.cs.

◆ AddDamage() [2/2]

void Barotrauma.LevelObject.AddDamage ( float  damage,
float  deltaTime,
Entity  attacker,
bool  isNetworkEvent = false 
)

Definition at line 177 of file LevelObject.cs.

◆ LocalToWorld()

Vector2 Barotrauma.LevelObject.LocalToWorld ( Vector2  localPosition,
float  swingState = 0.0f 
)

Definition at line 210 of file LevelObject.cs.

◆ Remove()

void Barotrauma.LevelObject.Remove ( )

Definition at line 228 of file LevelObject.cs.

◆ ServerWrite()

void Barotrauma.LevelObject.ServerWrite ( IWriteMessage  msg,
Client  c 
)

Definition at line 240 of file LevelObject.cs.

◆ ToString()

override string Barotrauma.LevelObject.ToString ( )

Definition at line 235 of file LevelObject.cs.

Member Data Documentation

◆ ActivePrefab

LevelObjectPrefab Barotrauma.LevelObject.ActivePrefab

Definition at line 26 of file LevelObject.cs.

◆ NetworkUpdateTimer

float Barotrauma.LevelObject.NetworkUpdateTimer

Definition at line 16 of file LevelObject.cs.

◆ ParentCave

Level.Cave Barotrauma.LevelObject.ParentCave

Definition at line 86 of file LevelObject.cs.

◆ Position

Vector3 Barotrauma.LevelObject.Position

Definition at line 14 of file LevelObject.cs.

◆ Prefab

readonly LevelObjectPrefab Barotrauma.LevelObject.Prefab

Definition at line 13 of file LevelObject.cs.

◆ Rotation

float Barotrauma.LevelObject.Rotation

Definition at line 20 of file LevelObject.cs.

◆ Scale

float Barotrauma.LevelObject.Scale

Definition at line 18 of file LevelObject.cs.

◆ tookDamage

bool Barotrauma.LevelObject.tookDamage
protected

Definition at line 24 of file LevelObject.cs.

Property Documentation

◆ Health

float Barotrauma.LevelObject.Health
get

Definition at line 59 of file LevelObject.cs.

◆ Name

string Barotrauma.LevelObject.Name
get

Definition at line 82 of file LevelObject.cs.

◆ NeedsNetworkSyncing

bool Barotrauma.LevelObject.NeedsNetworkSyncing
getset

Definition at line 40 of file LevelObject.cs.

◆ NeedsUpdate

bool Barotrauma.LevelObject.NeedsUpdate
get

Definition at line 54 of file LevelObject.cs.

◆ PhysicsBody

PhysicsBody Barotrauma.LevelObject.PhysicsBody
get

Definition at line 28 of file LevelObject.cs.

◆ SerializableProperties

Dictionary<Identifier, SerializableProperty> Barotrauma.LevelObject.SerializableProperties = new Dictionary<Identifier, SerializableProperty>()
get

Definition at line 84 of file LevelObject.cs.

◆ SimPosition

Vector2 Barotrauma.LevelObject.SimPosition
get

Definition at line 78 of file LevelObject.cs.

◆ Sprite

Sprite??? Barotrauma.LevelObject.Sprite
get

Definition at line 65 of file LevelObject.cs.

◆ Submarine

Submarine Barotrauma.LevelObject.Submarine
get

Definition at line 80 of file LevelObject.cs.

◆ Triggers

List<LevelTrigger> Barotrauma.LevelObject.Triggers
get

Definition at line 34 of file LevelObject.cs.

◆ WorldPosition

Vector2 Barotrauma.LevelObject.WorldPosition
get

Definition at line 76 of file LevelObject.cs.