Barotrauma Client
Loading...
Searching...
No Matches
Barotrauma.Structure Class Reference
Inheritance diagram for Barotrauma.Structure:
Barotrauma.MapEntity Barotrauma.IDamageable Barotrauma.Networking.IServerSerializable Barotrauma.ISerializableEntity Barotrauma.Entity Barotrauma.ISpatialEntity Barotrauma.Networking.INetSerializable Barotrauma.ISpatialEntity

Public Member Functions

override void Move (Vector2 amount, bool ignoreContacts=true)
 
 Structure (Rectangle rectangle, StructurePrefab sp, Submarine submarine, ushort id=Entity.NullEntityID, XElement element=null)
 
override string ToString ()
 
override MapEntity Clone ()
 
override Quad2D GetTransformedQuad ()
 
override bool IsMouseOn (Vector2 position)
 
override void ShallowRemove ()
 Remove the entity from the entity list without removing links to other entities.
 
override void Remove ()
 
WallSection GetSection (int sectionIndex)
 
bool SectionBodyDisabled (int sectionIndex)
 
bool AllSectionBodiesDisabled ()
 
bool SectionIsLeaking (int sectionIndex)
 Sections that are leaking have a gap placed on them.
 
bool SectionIsLeakingFromOutside (int sectionIndex)
 
int SectionLength (int sectionIndex)
 
override bool AddUpgrade (Upgrade upgrade, bool createNetworkEvent=false)
 Adds a new upgrade to the item.
 
void AddDamage (int sectionIndex, float damage, Character attacker=null, bool emitParticles=true, bool createWallDamageProjectiles=false)
 
int FindSectionIndex (Vector2 displayPos, bool world=false, bool clamp=false)
 
float SectionDamage (int sectionIndex)
 
Vector2 SectionPosition (int sectionIndex, bool world=false)
 
AttackResult AddDamage (Character attacker, Vector2 worldPosition, Attack attack, Vector2 impulseDirection, float deltaTime, bool playSound=false)
 
void SetDamage (int sectionIndex, float damage, Character attacker=null, bool createNetworkEvent=true, bool isNetworkEvent=true, bool createExplosionEffect=true, bool createWallDamageProjectiles=false)
 
void SetCollisionCategory (Category collisionCategory)
 
override void FlipX (bool relativeToSub)
 Flip the entity horizontally.
 
override void FlipY (bool relativeToSub)
 Flip the entity vertically.
 
override XElement Save (XElement parentElement)
 
override void OnMapLoaded ()
 
virtual void Reset ()
 
override void Update (float deltaTime, Camera cam)
 
- Public Member Functions inherited from Barotrauma.MapEntity
void AddLinked (MapEntity entity)
 
 MapEntity (MapEntityPrefab prefab, Submarine submarine, ushort id)
 
void ResolveLinks (IdRemap childRemap)
 
bool HasUpgrade (Identifier identifier)
 
Upgrade GetUpgrade (Identifier identifier)
 
List< Upgrade > GetUpgrades ()
 
void SetUpgrade (Upgrade upgrade, bool createNetworkEvent=false)
 
MapEntity Clone ()
 
void RemoveLinked (MapEntity e)
 
HashSet< T > GetLinkedEntities< T > (HashSet< T > list=null, int? maxDepth=null, Func< T, bool > filter=null)
 Gets all linked entities of specific type.
 
- 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.
 
- Public Member Functions inherited from Barotrauma.IDamageable

Static Public Member Functions

static Structure GetAttachTarget (Vector2 worldPosition)
 Checks if there's a structure items can be attached to at the given position and returns it.
 
static Structure Load (ContentXElement element, Submarine submarine, IdRemap idRemap)
 
static StructurePrefab FindPrefab (string name, Identifier identifier)
 
- Static Public Member Functions inherited from Barotrauma.MapEntity
static void ClearHighlightedEntities ()
 
static List< MapEntityClone (List< MapEntity > entitiesToClone)
 
static void UpdateAll (float deltaTime, Camera cam)
 Call Update() on every object in Entity.list.
 
static List< MapEntityLoadAll (Submarine submarine, XElement parentElement, string filePath, int idOffset)
 
static void MapLoaded (List< MapEntity > entities, bool updateHulls)
 
static void InitializeLoadedLinks (IEnumerable< MapEntity > entities)
 
- 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.
 
static Entity FindEntityByID (ushort ID)
 Find an entity based on the ID.
 
static void RemoveAll ()
 
static void DumpIds (int count, string filename)
 

Static Public Attributes

const int WallSectionSize = 96
 
static List< StructureWallList = new List<Structure>()
 
- Static Public Attributes inherited from Barotrauma.MapEntity
static readonly List< MapEntityMapEntityList = new List<MapEntity>()
 
static int MapEntityUpdateInterval = 1
 
static int PoweredUpdateInterval = 1
 
- 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 Attributes

Color spriteColor
 
float rotationRad = 0f
 
Vector2 textureScale = Vector2.One
 
Vector2 textureOffset = Vector2.Zero
 
- Protected Attributes inherited from Barotrauma.MapEntity
List< ushort > linkedToID
 
readonly List< Upgrade > Upgrades = new List<Upgrade>()
 List of upgrades this item has.
 
bool flippedX
 
bool flippedY
 
Rectangle rect
 
- Protected Attributes inherited from Barotrauma.Entity
AITarget aiTarget
 

Properties

bool Indestructible [get, set]
 
WallSection[] Sections [get]
 
override Sprite Sprite [get]
 
bool IsPlatform [get]
 
Direction StairDirection [get]
 
override string Name [get]
 
bool HasBody [get]
 
List< Body > Bodies [get]
 
bool CastShadow [get, set]
 
bool IsHorizontal [get]
 
int SectionCount [get]
 
float MaxHealth [get, set]
 
float CrushDepth [get, set]
 
float Health [get]
 
override bool DrawBelowWater [get]
 
override bool DrawOverWater [get]
 
bool DrawDamageEffect [get]
 
bool HasDamage [get]
 
new StructurePrefab Prefab [get]
 
ImmutableHashSet< Identifier > Tags [get]
 
string SpecialTag [get, set]
 
Color SpriteColor [get, set]
 
bool UseDropShadow [get]
 
Vector2 DropShadowOffset [get]
 
override float Scale [get, set]
 
float Rotation [get, set]
 
Vector2 TextureScale [get, set]
 
float ScaleWhenTextureOffsetSet = 1.0f [get]
 
Vector2 TextureOffset [get, set]
 
Rectangle DefaultRect [get, set]
 Unscaled rect.
 
override Rectangle Rect [get, set]
 
float BodyWidth [get]
 
float BodyHeight [get]
 
float BodyRotation [get]
 In radians, takes flipping into account.
 
Vector2 BodyOffset [get]
 Offset of the physics body from the center of the structure. Takes flipping into account.
 
bool NoAITarget [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 
Vector2 DirectionUnit [get]
 
- Properties inherited from Barotrauma.MapEntity
string DisallowedUpgrades [get, set]
 
bool FlippedX [get]
 
bool FlippedY [get]
 
static IEnumerable< MapEntityHighlightedEntities [get]
 
bool ExternalHighlight [get, set]
 
bool IsHighlighted [get, set]
 
virtual Rectangle Rect [get, set]
 
Rectangle WorldRect [get]
 
virtual Sprite Sprite [get]
 
virtual bool DrawBelowWater [get]
 
virtual bool DrawOverWater [get]
 
virtual bool Linkable [get]
 
IEnumerable< Identifier > AllowedLinks [get]
 
bool ResizeHorizontal [get]
 
bool ResizeVertical [get]
 
int RectWidth [get, set]
 
int RectHeight [get, set]
 
bool SpriteDepthOverrideIsSet [get]
 
float SpriteOverrideDepth [get]
 
float SpriteDepth [get, set]
 
virtual float Scale = 1 [get, set]
 
bool HiddenInGame [get, set]
 
bool IsLayerHidden [get, set]
 Is the layer this entity is in currently hidden? If it is, the entity is not updated and should do nothing.
 
bool IsHidden [get]
 Is the entity hidden due to HiddenInGame being enabled or the layer the entity is in being hidden?
 
override Vector2 Position [get]
 
override Vector2 SimPosition [get]
 
float SoundRange [get, set]
 
float SightRange [get, set]
 
bool RemoveIfLinkedOutpostDoorInUse = true [get, protected set]
 
string Layer [get, set]
 
virtual string Name [get]
 
- 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]
 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
- Properties inherited from Barotrauma.IDamageable
Vector2 SimPosition [get]
 
Vector2 WorldPosition [get]
 
- Properties inherited from Barotrauma.ISerializableEntity

Additional Inherited Members

- Public Attributes inherited from Barotrauma.MapEntity
readonly MapEntityPrefab Prefab
 
List< ushort > unresolvedLinkedToID
 
readonly HashSet< Identifier > DisallowedUpgradeSet = new HashSet<Identifier>()
 
readonly List< MapEntitylinkedTo = new List<MapEntity>()
 
bool ShouldBeSaved = true
 
int OriginalModuleIndex = -1
 The index of the outpost module this entity originally spawned in (-1 if not an outpost item)
 
int OriginalContainerIndex = -1
 
- 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.
 
readonly string CreationStackTrace
 
readonly UInt64 CreationIndex
 
- Protected Member Functions inherited from Barotrauma.MapEntity
void ParseLinks (XElement element, IdRemap idRemap)
 
virtual void CheckIsHighlighted ()
 
void InsertToList ()
 
- Protected Member Functions inherited from Barotrauma.Entity
virtual ushort DetermineID (ushort id, Submarine submarine)
 
- Static Protected Attributes inherited from Barotrauma.MapEntity
static readonly HashSet< MapEntityhighlightedEntities = new HashSet<MapEntity>()
 

Constructor & Destructor Documentation

◆ Structure()

Barotrauma.Structure.Structure ( Rectangle rectangle,
StructurePrefab sp,
Submarine submarine,
ushort id = Entity::NullEntityID,
XElement element = null )

Member Function Documentation

◆ AddDamage() [1/2]

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

◆ AddDamage() [2/2]

void Barotrauma.Structure.AddDamage ( int sectionIndex,
float damage,
Character attacker = null,
bool emitParticles = true,
bool createWallDamageProjectiles = false )

◆ AddUpgrade()

override bool Barotrauma.Structure.AddUpgrade ( Upgrade upgrade,
bool createNetworkEvent = false )
virtual

Adds a new upgrade to the item.

Reimplemented from Barotrauma.MapEntity.

◆ AllSectionBodiesDisabled()

bool Barotrauma.Structure.AllSectionBodiesDisabled ( )

◆ Clone()

override MapEntity Barotrauma.Structure.Clone ( )

◆ FindPrefab()

static StructurePrefab Barotrauma.Structure.FindPrefab ( string name,
Identifier identifier )
static

◆ FindSectionIndex()

int Barotrauma.Structure.FindSectionIndex ( Vector2 displayPos,
bool world = false,
bool clamp = false )

◆ FlipX()

override void Barotrauma.Structure.FlipX ( bool relativeToSub)
virtual

Flip the entity horizontally.

Parameters
relativeToSubShould the entity be flipped across the y-axis of the sub it's inside

Reimplemented from Barotrauma.MapEntity.

◆ FlipY()

override void Barotrauma.Structure.FlipY ( bool relativeToSub)
virtual

Flip the entity vertically.

Parameters
relativeToSubShould the entity be flipped across the x-axis of the sub it's inside

Reimplemented from Barotrauma.MapEntity.

◆ GetAttachTarget()

static Structure Barotrauma.Structure.GetAttachTarget ( Vector2 worldPosition)
static

Checks if there's a structure items can be attached to at the given position and returns it.

◆ GetSection()

WallSection Barotrauma.Structure.GetSection ( int sectionIndex)

◆ GetTransformedQuad()

override Quad2D Barotrauma.Structure.GetTransformedQuad ( )
virtual

Reimplemented from Barotrauma.MapEntity.

◆ IsMouseOn()

override bool Barotrauma.Structure.IsMouseOn ( Vector2 position)
virtual

Reimplemented from Barotrauma.MapEntity.

◆ Load()

static Structure Barotrauma.Structure.Load ( ContentXElement element,
Submarine submarine,
IdRemap idRemap )
static

◆ Move()

override void Barotrauma.Structure.Move ( Vector2 amount,
bool ignoreContacts = true )
virtual

Reimplemented from Barotrauma.MapEntity.

◆ OnMapLoaded()

override void Barotrauma.Structure.OnMapLoaded ( )
virtual

Reimplemented from Barotrauma.MapEntity.

◆ Remove()

override void Barotrauma.Structure.Remove ( )
virtual

Reimplemented from Barotrauma.MapEntity.

◆ Reset()

virtual void Barotrauma.Structure.Reset ( )
virtual

◆ Save()

override XElement Barotrauma.Structure.Save ( XElement parentElement)
virtual

Reimplemented from Barotrauma.MapEntity.

◆ SectionBodyDisabled()

bool Barotrauma.Structure.SectionBodyDisabled ( int sectionIndex)

◆ SectionDamage()

float Barotrauma.Structure.SectionDamage ( int sectionIndex)

◆ SectionIsLeaking()

bool Barotrauma.Structure.SectionIsLeaking ( int sectionIndex)

Sections that are leaking have a gap placed on them.

◆ SectionIsLeakingFromOutside()

bool Barotrauma.Structure.SectionIsLeakingFromOutside ( int sectionIndex)

◆ SectionLength()

int Barotrauma.Structure.SectionLength ( int sectionIndex)

◆ SectionPosition()

Vector2 Barotrauma.Structure.SectionPosition ( int sectionIndex,
bool world = false )

◆ SetCollisionCategory()

void Barotrauma.Structure.SetCollisionCategory ( Category collisionCategory)

◆ SetDamage()

void Barotrauma.Structure.SetDamage ( int sectionIndex,
float damage,
Character attacker = null,
bool createNetworkEvent = true,
bool isNetworkEvent = true,
bool createExplosionEffect = true,
bool createWallDamageProjectiles = false )

◆ ShallowRemove()

override void Barotrauma.Structure.ShallowRemove ( )
virtual

Remove the entity from the entity list without removing links to other entities.

Reimplemented from Barotrauma.MapEntity.

◆ ToString()

override string Barotrauma.Structure.ToString ( )

◆ Update()

override void Barotrauma.Structure.Update ( float deltaTime,
Camera cam )
virtual

Reimplemented from Barotrauma.MapEntity.

Member Data Documentation

◆ rotationRad

float Barotrauma.Structure.rotationRad = 0f
protected

◆ spriteColor

Color Barotrauma.Structure.spriteColor
protected

◆ textureOffset

Vector2 Barotrauma.Structure.textureOffset = Vector2.Zero
protected

◆ textureScale

Vector2 Barotrauma.Structure.textureScale = Vector2.One
protected

◆ WallList

List<Structure> Barotrauma.Structure.WallList = new List<Structure>()
static

◆ WallSectionSize

const int Barotrauma.Structure.WallSectionSize = 96
static

Property Documentation

◆ Bodies

List<Body> Barotrauma.Structure.Bodies
get

◆ BodyHeight

float Barotrauma.Structure.BodyHeight
get

◆ BodyOffset

Vector2 Barotrauma.Structure.BodyOffset
get

Offset of the physics body from the center of the structure. Takes flipping into account.

◆ BodyRotation

float Barotrauma.Structure.BodyRotation
get

In radians, takes flipping into account.

◆ BodyWidth

float Barotrauma.Structure.BodyWidth
get

◆ CastShadow

bool Barotrauma.Structure.CastShadow
getset

◆ CrushDepth

float Barotrauma.Structure.CrushDepth
getset

◆ DefaultRect

Rectangle Barotrauma.Structure.DefaultRect
getset

Unscaled rect.

◆ DirectionUnit

Vector2 Barotrauma.Structure.DirectionUnit
getprotected

◆ DrawBelowWater

override bool Barotrauma.Structure.DrawBelowWater
get

◆ DrawDamageEffect

bool Barotrauma.Structure.DrawDamageEffect
get

◆ DrawOverWater

override bool Barotrauma.Structure.DrawOverWater
get

◆ DropShadowOffset

Vector2 Barotrauma.Structure.DropShadowOffset
get

◆ HasBody

bool Barotrauma.Structure.HasBody
get

◆ HasDamage

bool Barotrauma.Structure.HasDamage
get

◆ Health

float Barotrauma.Structure.Health
get

◆ Indestructible

bool Barotrauma.Structure.Indestructible
getset

◆ IsHorizontal

bool Barotrauma.Structure.IsHorizontal
get

◆ IsPlatform

bool Barotrauma.Structure.IsPlatform
get

◆ MaxHealth

float Barotrauma.Structure.MaxHealth
getset

◆ Name

override string Barotrauma.Structure.Name
get

◆ NoAITarget

bool Barotrauma.Structure.NoAITarget
get

◆ Prefab

new StructurePrefab Barotrauma.Structure.Prefab
get

◆ Rect

override Rectangle Barotrauma.Structure.Rect
getset

◆ Rotation

float Barotrauma.Structure.Rotation
getset

◆ Scale

override float Barotrauma.Structure.Scale
getset

◆ ScaleWhenTextureOffsetSet

float Barotrauma.Structure.ScaleWhenTextureOffsetSet = 1.0f
get

◆ SectionCount

int Barotrauma.Structure.SectionCount
get

◆ Sections

WallSection [] Barotrauma.Structure.Sections
get

◆ SerializableProperties

Dictionary<Identifier, SerializableProperty> Barotrauma.Structure.SerializableProperties
get

◆ SpecialTag

string Barotrauma.Structure.SpecialTag
getset

◆ Sprite

override Sprite Barotrauma.Structure.Sprite
get

◆ SpriteColor

Color Barotrauma.Structure.SpriteColor
getset

◆ StairDirection

Direction Barotrauma.Structure.StairDirection
get

◆ Tags

ImmutableHashSet<Identifier> Barotrauma.Structure.Tags
get

◆ TextureOffset

Vector2 Barotrauma.Structure.TextureOffset
getset

◆ TextureScale

Vector2 Barotrauma.Structure.TextureScale
getset

◆ UseDropShadow

bool Barotrauma.Structure.UseDropShadow
get

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