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

Public Member Functions

override string ToString ()
 
int CalculateBasePrice ()
 
void AttemptBallastFloraInfection (Identifier identifier, float deltaTime, float probability)
 
void MakeWreck ()
 
bool CreateWreckAI ()
 
bool CreateTurretAI ()
 Creates an AI that operates all the turrets on a sub, same as Thalamus but only operates the turrets. More...
 
void DisableWreckAI ()
 
Rectangle GetDockedBorders (bool allowDifferentTeam=true)
 Returns a rect that contains the borders of this sub and all subs docked to it, excluding outposts More...
 
IEnumerable< SubmarineGetConnectedSubs ()
 Returns a list of all submarines that are connected to this one via docking ports, including this sub. More...
 
void RefreshConnectedSubs ()
 
Vector2 FindSpawnPos (Vector2 spawnPos, Point? submarineSize=null, float subDockingPortOffset=0.0f, int verticalMoveDir=0)
 Attempt to find a spawn position close to the specified position where the sub doesn't collide with walls/ruins More...
 
void UpdateTransform (bool interpolate=true)
 
Rectangle CalculateDimensions (bool onlyHulls=true)
 
void FlipX (List< Submarine > parents=null)
 
void EnableFactionSpecificEntities (Identifier factionIdentifier)
 
void Update (float deltaTime)
 
void ApplyForce (Vector2 force)
 
void EnableMaintainPosition ()
 
void NeutralizeBallast ()
 
void SetPrevTransform (Vector2 position)
 
void SetPosition (Vector2 position, List< Submarine > checkd=null, bool forceUndockFromStaticSubmarines=true)
 
void Translate (Vector2 amount)
 
bool IsConnectedTo (Submarine otherSub)
 Returns true if the sub is same as the other. More...
 
List< HullGetHulls (bool alsoFromConnectedSubs)
 
List< GapGetGaps (bool alsoFromConnectedSubs)
 
List< ItemGetItems (bool alsoFromConnectedSubs)
 
List< WayPointGetWaypoints (bool alsoFromConnectedSubs)
 
List< StructureGetWalls (bool alsoFromConnectedSubs)
 
List< T > GetEntities< T > (bool includingConnectedSubs, List< T > list)
 
List<(ItemContainer container, int freeSlots)> GetCargoContainers ()
 
IEnumerable< T > GetEntities< T > (bool includingConnectedSubs, IEnumerable< T > list)
 
bool IsEntityFoundOnThisSub (MapEntity entity, bool includingConnectedSubs, bool allowDifferentTeam=false, bool allowDifferentType=false)
 
 Submarine (SubmarineInfo info, bool showErrorMessages=true, Func< Submarine, List< MapEntity >> loadEntities=null, IdRemap linkedRemap=null)
 
bool CheckFuel ()
 
void SaveToXElement (XElement element)
 
bool TrySaveAs (string filePath, System.IO.MemoryStream previewImage=null)
 
override void Remove ()
 
void Dispose ()
 
void DisableObstructedWayPoints ()
 Permanently disables obstructed waypoints obstructed by the level. More...
 
void DisableObstructedWayPoints (Submarine otherSub)
 Temporarily disables waypoints obstructed by the other sub. More...
 
void EnableObstructedWaypoints (Submarine otherSub)
 Only affects temporarily disabled waypoints. More...
 
void RefreshOutdoorNodes ()
 
Item FindContainerFor (Item item, bool onlyPrimary, bool checkTransferConditions=false, bool allowConnectedSubs=false)
 
void CreateMiniMap (GUIComponent parent, IEnumerable< Entity > pointsOfInterest=null, bool ignoreOutpost=false)
 
void CheckForErrors ()
 
void ClientReadPosition (IReadMessage msg, float sendingTime)
 
void ClientEventRead (IReadMessage msg, 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...
 

Static Public Member Functions

static Vector2 VectorToWorldGrid (Vector2 position, Submarine sub=null, bool round=false)
 
static Rectangle AbsRect (Vector2 pos, Vector2 size)
 
static RectangleF AbsRectF (Vector2 pos, Vector2 size)
 
static bool RectContains (Rectangle rect, Vector2 pos, bool inclusive=false)
 
static bool RectsOverlap (Rectangle rect1, Rectangle rect2, bool inclusive=true)
 
static bool RectsOverlap (RectangleF rect1, RectangleF rect2, bool inclusive=true)
 
static Body PickBody (Vector2 rayStart, Vector2 rayEnd, IEnumerable< Body > ignoredBodies=null, Category? collisionCategory=null, bool ignoreSensors=true, Predicate< Fixture > customPredicate=null, bool allowInsideFixture=false)
 
static float LastPickedBodyDist (Body body)
 
static IEnumerable< Body > PickBodies (Vector2 rayStart, Vector2 rayEnd, IEnumerable< Body > ignoredBodies=null, Category? collisionCategory=null, bool ignoreSensors=true, Predicate< Fixture > customPredicate=null, bool allowInsideFixture=false)
 Returns a list of physics bodies the ray intersects with, sorted according to distance (the closest body is at the beginning of the list). More...
 
static Body CheckVisibility (Vector2 rayStart, Vector2 rayEnd, bool ignoreLevel=false, bool ignoreSubs=false, bool ignoreSensors=true, bool ignoreDisabledWalls=true, bool ignoreBranches=true, Predicate< Fixture > blocksVisibilityPredicate=null)
 Check visibility between two points (in sim units). More...
 
static ? Vector2 CalculateDockOffset (Submarine sub, Submarine dockedSub)
 
static Submarine FindClosest (Vector2 worldPosition, bool ignoreOutposts=false, bool ignoreOutsideLevel=true, bool ignoreRespawnShuttle=false, CharacterTeamType? teamType=null)
 
Parameters
teamTypeIf has value, the sub must match the team type.
More...
 
static Submarine FindContainingInLocalCoordinates (Vector2 position, float inflate=500.0f)
 Finds the sub whose borders contain the position. Note that this method uses the "actual" position of the sub outside the level: only use this if the position is in a submarine's local coordinate space! More...
 
static Submarine FindContaining (Vector2 worldPosition, float inflate=500.0f)
 Finds the sub whose world borders contain the position. More...
 
static Rectangle GetBorders (XElement submarineElement)
 
static Submarine Load (SubmarineInfo info, bool unloadPrevious, IdRemap linkedRemap=null)
 
static void RepositionEntities (Vector2 moveAmount, IEnumerable< MapEntity > entities)
 
static void Unload ()
 
static Vector2 GetRelativeSimPosition (ISpatialEntity from, ISpatialEntity to, Vector2? targetWorldPos=null)
 
static Vector2 GetRelativeSimPositionFromWorldPosition (Vector2 targetWorldPos, Submarine fromSub, Submarine toSub)
 
static Vector2 GetRelativeSimPosition (Vector2 targetSimPos, Submarine fromSub, Submarine toSub)
 
static void CullEntities (Camera cam)
 
static void ForceVisibilityRecheck ()
 
static void ForceRemoveFromVisibleEntities (MapEntity entity)
 
static void Draw (SpriteBatch spriteBatch, bool editing=false)
 
static void DrawFront (SpriteBatch spriteBatch, bool editing=false, Predicate< MapEntity > predicate=null)
 
static void DrawDamageable (SpriteBatch spriteBatch, Effect damageEffect, bool editing=false, Predicate< MapEntity > predicate=null)
 
static void DrawPaintedColors (SpriteBatch spriteBatch, bool editing=false, Predicate< MapEntity > predicate=null)
 
static void DrawBack (SpriteBatch spriteBatch, bool editing=false, Predicate< MapEntity > predicate=null)
 
static void DrawGrid (SpriteBatch spriteBatch, int gridCells, Vector2 gridCenter, Vector2 roundedGridCenter, float alpha=1.0f)
 
static MiniMapHullData ConstructLinkedHulls (Hull mainHull, HashSet< Hull > linkedHulls, GUIComponent parent, Rectangle worldBorders)
 
static int GetLightCount ()
 
static int GetShadowCastingLightCount ()
 
static Vector2 MouseToWorldGrid (Camera cam, Submarine sub, Vector2? mousePos=null, bool round=false)
 
- 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)
 

Public Attributes

CharacterTeamType TeamID = CharacterTeamType.None
 
readonly Dictionary< Submarine, DockingPortConnectedDockingPorts
 
bool ShowSonarMarker = true
 
- 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
 

Static Public Attributes

static readonly Vector2 HiddenSubStartPosition = new Vector2(-50000.0f, 10000.0f)
 
static bool LockX
 
static readonly Vector2 GridSize = new Vector2(16.0f, 16.0f)
 
static readonly Submarine[] MainSubs = new Submarine[2]
 
static float DamageEffectCutoff
 
static Color DamageEffectColor
 
- 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

override ushort DetermineID (ushort id, Submarine submarine)
 

Properties

SubmarineInfo Info [get]
 
Vector2 HiddenSubPosition [get]
 
ushort IdOffset [get]
 
static Submarine MainSub [get, set]
 
static IEnumerable< MapEntityVisibleEntities [get]
 
IEnumerable< SubmarineDockedTo [get]
 
static Vector2 LastPickedPosition [get]
 
static float LastPickedFraction [get]
 
static Fixture LastPickedFixture [get]
 
static Vector2 LastPickedNormal [get]
 
bool Loading [get]
 
bool GodMode [get, set]
 
static List< SubmarineLoaded [get]
 
SubmarineBody SubBody [get]
 
PhysicsBodyPhysicsBody [get]
 
Rectangle? Borders [get]
 Extents of the solid items/structures (ones with a physics body) and hulls More...
 
Rectangle? VisibleBorders [get]
 Extents of all the visible items/structures/hulls (including ones without a physics body) More...
 
override Vector2? Position [get]
 
override Vector2? WorldPosition [get]
 
float RealWorldCrushDepth [get, set]
 
float? RealWorldDepth [get]
 How deep down the sub is from the surface of Europa in meters (affected by level type, does not correspond to "actual" coordinate systems) More...
 
bool AtEndExit [get]
 
bool AtStartExit [get]
 
bool AtEitherExit [get]
 
new Vector2 DrawPosition [get]
 
override Vector2 SimPosition [get]
 
Vector2? Velocity [get, set]
 
List< Vector2 >? HullVertices [get]
 
int??? SubmarineSpecificIDTag [get]
 
bool AtDamageDepth [get]
 
IReadOnlyList< WayPointExitPoints [get]
 
bool ImmuneToBallastFlora [get, set]
 
WreckAI WreckAI [get]
 
SubmarineTurretAI TurretAI [get]
 
bool FlippedX [get]
 
static bool Unloading [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]
 
double SpawnTime [get]
 
string ErrorLine [get]
 
- Properties inherited from Barotrauma.ISpatialEntity
Vector2 Position [get]
 
Vector2 WorldPosition [get]
 
Vector2 SimPosition [get]
 
Submarine Submarine [get]
 

Additional Inherited Members

- Protected Attributes inherited from Barotrauma.Entity
AITarget aiTarget
 

Detailed Description

Constructor & Destructor Documentation

◆ Submarine()

Barotrauma.Submarine.Submarine ( SubmarineInfo  info,
bool  showErrorMessages = true,
Func< Submarine, List< MapEntity >>  loadEntities = null,
IdRemap  linkedRemap = null 
)

Member Function Documentation

◆ AbsRect()

static Rectangle Barotrauma.Submarine.AbsRect ( Vector2  pos,
Vector2  size 
)
static

◆ AbsRectF()

static RectangleF Barotrauma.Submarine.AbsRectF ( Vector2  pos,
Vector2  size 
)
static

◆ ApplyForce()

void Barotrauma.Submarine.ApplyForce ( Vector2  force)

◆ AttemptBallastFloraInfection()

void Barotrauma.Submarine.AttemptBallastFloraInfection ( Identifier  identifier,
float  deltaTime,
float  probability 
)

◆ CalculateBasePrice()

int Barotrauma.Submarine.CalculateBasePrice ( )

◆ CalculateDimensions()

Rectangle Barotrauma.Submarine.CalculateDimensions ( bool  onlyHulls = true)

◆ CalculateDockOffset()

static ? Vector2 Barotrauma.Submarine.CalculateDockOffset ( Submarine  sub,
Submarine  dockedSub 
)
static

◆ CheckForErrors()

void Barotrauma.Submarine.CheckForErrors ( )

◆ CheckFuel()

bool Barotrauma.Submarine.CheckFuel ( )

◆ CheckVisibility()

static Body Barotrauma.Submarine.CheckVisibility ( Vector2  rayStart,
Vector2  rayEnd,
bool  ignoreLevel = false,
bool  ignoreSubs = false,
bool  ignoreSensors = true,
bool  ignoreDisabledWalls = true,
bool  ignoreBranches = true,
Predicate< Fixture >  blocksVisibilityPredicate = null 
)
static

Check visibility between two points (in sim units).

Parameters
ignoreBranchesShould plants' branches be ignored?
blocksVisibilityPredicateIf the predicate returns false, the fixture is ignored even if it would normally block visibility.
Returns
A physics body that was between the points (or null)

Definition at line 958 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ ClientEventRead()

void Barotrauma.Submarine.ClientEventRead ( IReadMessage  msg,
float  sendingTime 
)

◆ ClientReadPosition()

void Barotrauma.Submarine.ClientReadPosition ( IReadMessage  msg,
float  sendingTime 
)

◆ ConstructLinkedHulls()

static MiniMapHullData Barotrauma.Submarine.ConstructLinkedHulls ( Hull  mainHull,
HashSet< Hull linkedHulls,
GUIComponent  parent,
Rectangle  worldBorders 
)
static

◆ CreateMiniMap()

void Barotrauma.Submarine.CreateMiniMap ( GUIComponent  parent,
IEnumerable< Entity pointsOfInterest = null,
bool  ignoreOutpost = false 
)

◆ CreateTurretAI()

bool Barotrauma.Submarine.CreateTurretAI ( )

Creates an AI that operates all the turrets on a sub, same as Thalamus but only operates the turrets.

Definition at line 407 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ CreateWreckAI()

bool Barotrauma.Submarine.CreateWreckAI ( )

◆ CullEntities()

static void Barotrauma.Submarine.CullEntities ( Camera  cam)
static

◆ DetermineID()

override ushort Barotrauma.Submarine.DetermineID ( ushort  id,
Submarine  submarine 
)
protectedvirtual

Reimplemented from Barotrauma.Entity.

Definition at line 1708 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ DisableObstructedWayPoints() [1/2]

void Barotrauma.Submarine.DisableObstructedWayPoints ( )

Permanently disables obstructed waypoints obstructed by the level.

Definition at line 2032 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ DisableObstructedWayPoints() [2/2]

void Barotrauma.Submarine.DisableObstructedWayPoints ( Submarine  otherSub)

Temporarily disables waypoints obstructed by the other sub.

Definition at line 2060 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ DisableWreckAI()

void Barotrauma.Submarine.DisableWreckAI ( )

◆ Dispose()

void Barotrauma.Submarine.Dispose ( )

◆ Draw()

static void Barotrauma.Submarine.Draw ( SpriteBatch  spriteBatch,
bool  editing = false 
)
static

◆ DrawBack()

static void Barotrauma.Submarine.DrawBack ( SpriteBatch  spriteBatch,
bool  editing = false,
Predicate< MapEntity predicate = null 
)
static

◆ DrawDamageable()

static void Barotrauma.Submarine.DrawDamageable ( SpriteBatch  spriteBatch,
Effect  damageEffect,
bool  editing = false,
Predicate< MapEntity predicate = null 
)
static

◆ DrawFront()

static void Barotrauma.Submarine.DrawFront ( SpriteBatch  spriteBatch,
bool  editing = false,
Predicate< MapEntity predicate = null 
)
static

◆ DrawGrid()

static void Barotrauma.Submarine.DrawGrid ( SpriteBatch  spriteBatch,
int  gridCells,
Vector2  gridCenter,
Vector2  roundedGridCenter,
float  alpha = 1.0f 
)
static

◆ DrawPaintedColors()

static void Barotrauma.Submarine.DrawPaintedColors ( SpriteBatch  spriteBatch,
bool  editing = false,
Predicate< MapEntity predicate = null 
)
static

◆ EnableFactionSpecificEntities()

void Barotrauma.Submarine.EnableFactionSpecificEntities ( Identifier  factionIdentifier)

◆ EnableMaintainPosition()

void Barotrauma.Submarine.EnableMaintainPosition ( )

◆ EnableObstructedWaypoints()

void Barotrauma.Submarine.EnableObstructedWaypoints ( Submarine  otherSub)

Only affects temporarily disabled waypoints.

Definition at line 2108 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ FindClosest()

static Submarine Barotrauma.Submarine.FindClosest ( Vector2  worldPosition,
bool  ignoreOutposts = false,
bool  ignoreOutsideLevel = true,
bool  ignoreRespawnShuttle = false,
CharacterTeamType teamType = null 
)
static

Parameters
teamTypeIf has value, the sub must match the team type.

Definition at line 1349 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ FindContainerFor()

Item Barotrauma.Submarine.FindContainerFor ( Item  item,
bool  onlyPrimary,
bool  checkTransferConditions = false,
bool  allowConnectedSubs = false 
)

◆ FindContaining()

static Submarine Barotrauma.Submarine.FindContaining ( Vector2  worldPosition,
float  inflate = 500.0f 
)
static

Finds the sub whose world borders contain the position.

Definition at line 1447 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ FindContainingInLocalCoordinates()

static Submarine Barotrauma.Submarine.FindContainingInLocalCoordinates ( Vector2  position,
float  inflate = 500.0f 
)
static

Finds the sub whose borders contain the position. Note that this method uses the "actual" position of the sub outside the level: only use this if the position is in a submarine's local coordinate space!

Definition at line 1431 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ FindSpawnPos()

Vector2 Barotrauma.Submarine.FindSpawnPos ( Vector2  spawnPos,
Point?  submarineSize = null,
float  subDockingPortOffset = 0.0f,
int  verticalMoveDir = 0 
)

Attempt to find a spawn position close to the specified position where the sub doesn't collide with walls/ruins

Definition at line 494 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ FlipX()

void Barotrauma.Submarine.FlipX ( List< Submarine parents = null)

◆ ForceRemoveFromVisibleEntities()

static void Barotrauma.Submarine.ForceRemoveFromVisibleEntities ( MapEntity  entity)
static

◆ ForceVisibilityRecheck()

static void Barotrauma.Submarine.ForceVisibilityRecheck ( )
static

◆ GetBorders()

static Rectangle Barotrauma.Submarine.GetBorders ( XElement  submarineElement)
static

◆ GetCargoContainers()

List<(ItemContainer container, int freeSlots)> Barotrauma.Submarine.GetCargoContainers ( )

◆ GetConnectedSubs()

IEnumerable<Submarine> Barotrauma.Submarine.GetConnectedSubs ( )

Returns a list of all submarines that are connected to this one via docking ports, including this sub.

Definition at line 469 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ GetDockedBorders()

Rectangle Barotrauma.Submarine.GetDockedBorders ( bool  allowDifferentTeam = true)

Returns a rect that contains the borders of this sub and all subs docked to it, excluding outposts

Definition at line 431 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ GetEntities< T >() [1/2]

IEnumerable<T> Barotrauma.Submarine.GetEntities< T > ( bool  includingConnectedSubs,
IEnumerable< T >  list 
)
Type Constraints
T :MapEntity 

Definition at line 1410 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ GetEntities< T >() [2/2]

List<T> Barotrauma.Submarine.GetEntities< T > ( bool  includingConnectedSubs,
List< T >  list 
)
Type Constraints
T :MapEntity 

Definition at line 1384 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ GetGaps()

List<Gap> Barotrauma.Submarine.GetGaps ( bool  alsoFromConnectedSubs)

◆ GetHulls()

List<Hull> Barotrauma.Submarine.GetHulls ( bool  alsoFromConnectedSubs)

◆ GetItems()

List<Item> Barotrauma.Submarine.GetItems ( bool  alsoFromConnectedSubs)

◆ GetLightCount()

static int Barotrauma.Submarine.GetLightCount ( )
static

◆ GetRelativeSimPosition() [1/2]

static Vector2 Barotrauma.Submarine.GetRelativeSimPosition ( ISpatialEntity  from,
ISpatialEntity  to,
Vector2?  targetWorldPos = null 
)
static

◆ GetRelativeSimPosition() [2/2]

static Vector2 Barotrauma.Submarine.GetRelativeSimPosition ( Vector2  targetSimPos,
Submarine  fromSub,
Submarine  toSub 
)
static

◆ GetRelativeSimPositionFromWorldPosition()

static Vector2 Barotrauma.Submarine.GetRelativeSimPositionFromWorldPosition ( Vector2  targetWorldPos,
Submarine  fromSub,
Submarine  toSub 
)
static

◆ GetShadowCastingLightCount()

static int Barotrauma.Submarine.GetShadowCastingLightCount ( )
static

◆ GetWalls()

List<Structure> Barotrauma.Submarine.GetWalls ( bool  alsoFromConnectedSubs)

◆ GetWaypoints()

List<WayPoint> Barotrauma.Submarine.GetWaypoints ( bool  alsoFromConnectedSubs)

◆ IsConnectedTo()

bool Barotrauma.Submarine.IsConnectedTo ( Submarine  otherSub)

Returns true if the sub is same as the other.

◆ IsEntityFoundOnThisSub()

bool Barotrauma.Submarine.IsEntityFoundOnThisSub ( MapEntity  entity,
bool  includingConnectedSubs,
bool  allowDifferentTeam = false,
bool  allowDifferentType = false 
)

◆ LastPickedBodyDist()

static float Barotrauma.Submarine.LastPickedBodyDist ( Body  body)
static

◆ Load()

static Submarine Barotrauma.Submarine.Load ( SubmarineInfo  info,
bool  unloadPrevious,
IdRemap  linkedRemap = null 
)
static

◆ MakeWreck()

void Barotrauma.Submarine.MakeWreck ( )

◆ MouseToWorldGrid()

static Vector2 Barotrauma.Submarine.MouseToWorldGrid ( Camera  cam,
Submarine  sub,
Vector2?  mousePos = null,
bool  round = false 
)
static

◆ NeutralizeBallast()

void Barotrauma.Submarine.NeutralizeBallast ( )

◆ PickBodies()

static IEnumerable<Body> Barotrauma.Submarine.PickBodies ( Vector2  rayStart,
Vector2  rayEnd,
IEnumerable< Body >  ignoredBodies = null,
Category?  collisionCategory = null,
bool  ignoreSensors = true,
Predicate< Fixture >  customPredicate = null,
bool  allowInsideFixture = false 
)
static

Returns a list of physics bodies the ray intersects with, sorted according to distance (the closest body is at the beginning of the list).

Parameters
customPredicateCan be used to filter the bodies based on some condition. If the predicate returns false, the body isignored.
allowInsideFixtureShould fixtures that the start of the ray is inside be returned

Definition at line 855 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ PickBody()

static Body Barotrauma.Submarine.PickBody ( Vector2  rayStart,
Vector2  rayEnd,
IEnumerable< Body >  ignoredBodies = null,
Category?  collisionCategory = null,
bool  ignoreSensors = true,
Predicate< Fixture >  customPredicate = null,
bool  allowInsideFixture = false 
)
static

◆ RectContains()

static bool Barotrauma.Submarine.RectContains ( Rectangle  rect,
Vector2  pos,
bool  inclusive = false 
)
static

◆ RectsOverlap() [1/2]

static bool Barotrauma.Submarine.RectsOverlap ( Rectangle  rect1,
Rectangle  rect2,
bool  inclusive = true 
)
static

◆ RectsOverlap() [2/2]

static bool Barotrauma.Submarine.RectsOverlap ( RectangleF  rect1,
RectangleF  rect2,
bool  inclusive = true 
)
static

◆ RefreshConnectedSubs()

void Barotrauma.Submarine.RefreshConnectedSubs ( )

◆ RefreshOutdoorNodes()

void Barotrauma.Submarine.RefreshOutdoorNodes ( )

◆ Remove()

override void Barotrauma.Submarine.Remove ( )
virtual

Reimplemented from Barotrauma.Entity.

Definition at line 1968 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ RepositionEntities()

static void Barotrauma.Submarine.RepositionEntities ( Vector2  moveAmount,
IEnumerable< MapEntity entities 
)
static

◆ SaveToXElement()

void Barotrauma.Submarine.SaveToXElement ( XElement  element)

◆ SetPosition()

void Barotrauma.Submarine.SetPosition ( Vector2  position,
List< Submarine checkd = null,
bool  forceUndockFromStaticSubmarines = true 
)

◆ SetPrevTransform()

void Barotrauma.Submarine.SetPrevTransform ( Vector2  position)

◆ ToString()

override string Barotrauma.Submarine.ToString ( )

◆ Translate()

void Barotrauma.Submarine.Translate ( Vector2  amount)

◆ TrySaveAs()

bool Barotrauma.Submarine.TrySaveAs ( string  filePath,
System.IO.MemoryStream  previewImage = null 
)

◆ Unload()

static void Barotrauma.Submarine.Unload ( )
static

◆ Update()

void Barotrauma.Submarine.Update ( float  deltaTime)

◆ UpdateTransform()

void Barotrauma.Submarine.UpdateTransform ( bool  interpolate = true)

◆ VectorToWorldGrid()

static Vector2 Barotrauma.Submarine.VectorToWorldGrid ( Vector2  position,
Submarine  sub = null,
bool  round = false 
)
static

Member Data Documentation

◆ ConnectedDockingPorts

readonly Dictionary<Submarine, DockingPort> Barotrauma.Submarine.ConnectedDockingPorts

◆ DamageEffectColor

Color Barotrauma.Submarine.DamageEffectColor
static

◆ DamageEffectCutoff

float Barotrauma.Submarine.DamageEffectCutoff
static

◆ GridSize

readonly Vector2 Barotrauma.Submarine.GridSize = new Vector2(16.0f, 16.0f)
static

◆ HiddenSubStartPosition

readonly Vector2 Barotrauma.Submarine.HiddenSubStartPosition = new Vector2(-50000.0f, 10000.0f)
static

◆ LockX

bool Barotrauma.Submarine.LockX
static

◆ MainSubs

readonly Submarine [] Barotrauma.Submarine.MainSubs = new Submarine[2]
static

◆ ShowSonarMarker

bool Barotrauma.Submarine.ShowSonarMarker = true

◆ TeamID

CharacterTeamType Barotrauma.Submarine.TeamID = CharacterTeamType.None

Property Documentation

◆ AtDamageDepth

bool Barotrauma.Submarine.AtDamageDepth
get

◆ AtEitherExit

bool Barotrauma.Submarine.AtEitherExit
get

◆ AtEndExit

bool Barotrauma.Submarine.AtEndExit
get

◆ AtStartExit

bool Barotrauma.Submarine.AtStartExit
get

◆ Borders

Rectangle? Barotrauma.Submarine.Borders
get

Extents of the solid items/structures (ones with a physics body) and hulls

Definition at line 143 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ DockedTo

IEnumerable<Submarine> Barotrauma.Submarine.DockedTo
get

◆ DrawPosition

new Vector2 Barotrauma.Submarine.DrawPosition
get

◆ ExitPoints

IReadOnlyList<WayPoint> Barotrauma.Submarine.ExitPoints
get

◆ FlippedX

bool Barotrauma.Submarine.FlippedX
get

◆ GodMode

bool Barotrauma.Submarine.GodMode
getset

◆ HiddenSubPosition

Vector2 Barotrauma.Submarine.HiddenSubPosition
get

◆ HullVertices

List<Vector2>? Barotrauma.Submarine.HullVertices
get

◆ IdOffset

ushort Barotrauma.Submarine.IdOffset
get

◆ ImmuneToBallastFlora

bool Barotrauma.Submarine.ImmuneToBallastFlora
getset

◆ Info

SubmarineInfo Barotrauma.Submarine.Info
get

◆ LastPickedFixture

Fixture Barotrauma.Submarine.LastPickedFixture
staticget

◆ LastPickedFraction

float Barotrauma.Submarine.LastPickedFraction
staticget

◆ LastPickedNormal

Vector2 Barotrauma.Submarine.LastPickedNormal
staticget

◆ LastPickedPosition

Vector2 Barotrauma.Submarine.LastPickedPosition
staticget

◆ Loaded

List<Submarine> Barotrauma.Submarine.Loaded
staticget

◆ Loading

bool Barotrauma.Submarine.Loading
get

◆ MainSub

Submarine Barotrauma.Submarine.MainSub
staticgetset

◆ PhysicsBody

PhysicsBody? Barotrauma.Submarine.PhysicsBody
get

◆ Position

override Vector2? Barotrauma.Submarine.Position
get

◆ RealWorldCrushDepth

float Barotrauma.Submarine.RealWorldCrushDepth
getset

◆ RealWorldDepth

float? Barotrauma.Submarine.RealWorldDepth
get

How deep down the sub is from the surface of Europa in meters (affected by level type, does not correspond to "actual" coordinate systems)

Definition at line 197 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ SimPosition

override Vector2 Barotrauma.Submarine.SimPosition
get

◆ SubBody

SubmarineBody Barotrauma.Submarine.SubBody
get

◆ SubmarineSpecificIDTag

int??? Barotrauma.Submarine.SubmarineSpecificIDTag
get

◆ TurretAI

SubmarineTurretAI Barotrauma.Submarine.TurretAI
get

◆ Unloading

bool Barotrauma.Submarine.Unloading
staticget

◆ Velocity

Vector2? Barotrauma.Submarine.Velocity
getset

◆ VisibleBorders

Rectangle? Barotrauma.Submarine.VisibleBorders
get

Extents of all the visible items/structures/hulls (including ones without a physics body)

Definition at line 154 of file BarotraumaShared/SharedSource/Map/Submarine.cs.

◆ VisibleEntities

IEnumerable<MapEntity> Barotrauma.Submarine.VisibleEntities
staticget

◆ WorldPosition

override Vector2? Barotrauma.Submarine.WorldPosition
get

◆ WreckAI

WreckAI Barotrauma.Submarine.WreckAI
get