Barotrauma Client Doc
Barotrauma.Gap Class Reference
Inheritance diagram for Barotrauma.Gap:
Barotrauma.MapEntity Barotrauma.ISerializableEntity Barotrauma.MapEntity Barotrauma.Entity Barotrauma.ISpatialEntity Barotrauma.Entity Barotrauma.Entity Barotrauma.ISpatialEntity Barotrauma.Entity Barotrauma.ISpatialEntity Barotrauma.ISpatialEntity Barotrauma.ISpatialEntity Barotrauma.ISpatialEntity

Public Member Functions

 Gap (Rectangle rectangle)
 
 Gap (Rectangle rect, Submarine submarine)
 
 Gap (Rectangle rect, bool isHorizontal, Submarine submarine, bool isDiagonal=false, ushort id=Entity.NullEntityID)
 
override MapEntity Clone ()
 
override void Move (Vector2 amount, bool ignoreContacts=true)
 
override bool IsMouseOn (Vector2 position)
 
void AutoOrient ()
 
override void Update (float deltaTime, Camera cam)
 
bool RefreshOutsideCollider ()
 
override void ShallowRemove ()
 Remove the entity from the entity list without removing links to other entities More...
 
override void Remove ()
 
override void OnMapLoaded ()
 
override XElement Save (XElement parentElement)
 
override bool IsVisible (Rectangle worldView)
 
override void Draw (SpriteBatch sb, bool editing, bool back=true)
 
override void UpdateEditing (Camera cam, float deltaTime)
 
- 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)
 
virtual bool AddUpgrade (Upgrade upgrade, bool createNetworkEvent=false)
 Adds a new upgrade to the item More...
 
override void Remove ()
 
virtual void FlipX (bool relativeToSub)
 Flip the entity horizontally More...
 
virtual void FlipY (bool relativeToSub)
 Flip the entity vertically More...
 
virtual Quad2D GetTransformedQuad ()
 
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. More...
 
float GetDrawDepth (float baseDepth, Sprite sprite)
 A method that modifies the draw depth to prevent z-fighting between entities with the same sprite depth More...
 
MapEntity GetReplacementOrThis ()
 
virtual void AddToGUIUpdateList (int order=0)
 
virtual void DrawEditing (SpriteBatch spriteBatch, Camera cam)
 
- 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 void UpdateHulls ()
 
static Gap FindAdjacent (IEnumerable< Gap > gaps, Vector2 worldPos, float allowedOrthogonalDist)
 
static Gap Load (ContentXElement element, Submarine submarine, IdRemap idRemap)
 
- 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 More...
 
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 void UpdateSelecting (Camera cam)
 Update the selection logic in submarine editor More...
 
static void StopSelection ()
 
static Vector2 GetNudgeAmount (bool doHold=true)
 
static Item GetPotentialContainer (Vector2 position, HashSet< MapEntity > entities=null)
 
static void UpdateHighlighting (List< MapEntity > highlightedEntities, bool wiringMode=false)
 Updates the logic that runs the highlight box when the mouse is sitting still. More...
 
static void AddSelection (MapEntity entity)
 
static void RemoveSelection (MapEntity entity)
 
static void DrawSelecting (SpriteBatch spriteBatch, Camera cam)
 Draw the "selection rectangle" and outlines of entities that are being dragged (if any) More...
 
static void DrawSelectionRect (SpriteBatch spriteBatch, Vector2 pos, Vector2 size, Color color)
 
static void UpdateEditor (Camera cam, float deltaTime)
 
static void DrawEditor (SpriteBatch spriteBatch, Camera cam)
 
static void DeselectAll ()
 
static void SelectEntity (MapEntity entity)
 
static void Copy (List< MapEntity > entities)
 Copy the selected entities to the "clipboard" (copiedList) More...
 
static void Cut (List< MapEntity > entities)
 
static void Paste (Vector2 position)
 
static List< MapEntityCopyEntities (List< MapEntity > entities)
 copies a list of entities to the "clipboard" (copiedList) More...
 
static HashSet< MapEntityFindSelectedEntities (Vector2 pos, Vector2 size)
 Find entities whose rect intersects with the "selection rect" More...
 
- 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

readonly float GlowEffectT
 
bool DisableHullRechecks
 
bool PassAmbientLight
 
Structure ConnectedWall
 
readonly Dictionary< Identifier, SerializablePropertyproperties
 
- Public Attributes inherited from Barotrauma.MapEntity
readonly MapEntityPrefab Prefab
 
List< ushort > unresolvedLinkedToID
 
readonly HashSet< IdentifierDisallowedUpgradeSet = 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) More...
 
int OriginalContainerIndex = -1
 
MapEntity ReplacedBy
 Used for undo/redo to determine what this item has been replaced with More...
 
- 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 List< GapGapList = new List<Gap>()
 
static bool ShowGaps = true
 
- Static Public Attributes inherited from Barotrauma.MapEntity
static readonly List< MapEntityMapEntityList = new List<MapEntity>()
 
static int MapEntityUpdateInterval = 1
 
static int PoweredUpdateInterval = 1
 
static bool SelectionChanged
 
static List< MapEntityCopiedList = new List<MapEntity>()
 
- 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
 

Properties

bool IsHorizontal [get]
 
bool IsDiagonal [get]
 "Diagonal" gaps are used on sloped walls to allow characters to pass through them either horizontally or vertically. Water still flows through them only horizontally or vertically More...
 
float Open [get, set]
 
float Size [get]
 
float PressureDistributionSpeed [get]
 
Door ConnectedDoor [get, set]
 
Vector2 LerpedFlowForce [get]
 
Hull FlowTargetHull [get]
 
bool IsRoomToRoom [get]
 
override Rectangle Rect [get, set]
 
override string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 
override bool SelectableInEditor [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< IdentifierAllowedLinks [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]
 
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]
 
static Vector2 StartMovingPos [get]
 
static Vector2 SelectionPos [get]
 
static bool Resizing [get]
 
static HashSet< MapEntitySelectedList = new HashSet<MapEntity>() [get]
 
static GUIListBox HighlightedListBox [get]
 
static GUIComponent EditingHUD [get]
 
static bool DisableSelect [get, set]
 
virtual bool SelectableInEditor [get]
 
static bool SelectedAny [get]
 
bool IsSelected [get]
 
bool IsIncludedInSelection [get, set]
 
static List< MapEntityFilteredSelectedList = new List<MapEntity>() [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]
 
- Properties inherited from Barotrauma.ISerializableEntity
string Name [get]
 
Dictionary< Identifier, SerializablePropertySerializableProperties [get]
 

Additional Inherited Members

- Protected Member Functions inherited from Barotrauma.MapEntity
void ParseLinks (XElement element, IdRemap idRemap)
 
virtual void CheckIsHighlighted ()
 
void InsertToList ()
 
Vector2 GetCollapseEffectOffset ()
 
- Protected Member Functions inherited from Barotrauma.Entity
virtual ushort DetermineID (ushort id, Submarine submarine)
 
- Static Protected Member Functions inherited from Barotrauma.MapEntity
static void ColorFlipButton (GUIButton btn, bool flip)
 
static void PositionEditingHUD ()
 
- Protected Attributes inherited from Barotrauma.MapEntity
List< ushort > linkedToID
 
readonly List< Upgrade > Upgrades = new List<Upgrade>()
 List of upgrades this item has More...
 
bool flippedX
 
Rectangle rect
 
- Protected Attributes inherited from Barotrauma.Entity
AITarget aiTarget
 
- Static Protected Attributes inherited from Barotrauma.MapEntity
static readonly HashSet< MapEntityhighlightedEntities = new HashSet<MapEntity>()
 
static Vector2 selectionPos = Vector2.Zero
 
static Vector2 selectionSize = Vector2.Zero
 
static GUIComponent editingHUD
 
- Events inherited from Barotrauma.MapEntity
Action< Rectangle > Resized
 

Detailed Description

Definition at line 13 of file BarotraumaShared/SharedSource/Map/Gap.cs.

Constructor & Destructor Documentation

◆ Gap() [1/3]

Barotrauma.Gap.Gap ( Rectangle  rectangle)

Definition at line 171 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ Gap() [2/3]

Barotrauma.Gap.Gap ( Rectangle  rect,
Submarine  submarine 
)

Definition at line 182 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ Gap() [3/3]

Barotrauma.Gap.Gap ( Rectangle  rect,
bool  isHorizontal,
Submarine  submarine,
bool  isDiagonal = false,
ushort  id = Entity.NullEntityID 
)

Definition at line 186 of file BarotraumaShared/SharedSource/Map/Gap.cs.

Member Function Documentation

◆ AutoOrient()

void Barotrauma.Gap.AutoOrient ( )

Definition at line 261 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ Clone()

override MapEntity Barotrauma.Gap.Clone ( )
virtual

Implements Barotrauma.MapEntity.

Definition at line 220 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ Draw()

override void Barotrauma.Gap.Draw ( SpriteBatch  sb,
bool  editing,
bool  back = true 
)
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 26 of file BarotraumaClient/ClientSource/Map/Gap.cs.

◆ FindAdjacent()

static Gap Barotrauma.Gap.FindAdjacent ( IEnumerable< Gap gaps,
Vector2  worldPos,
float  allowedOrthogonalDist 
)
static

Definition at line 764 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ IsMouseOn()

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

Reimplemented from Barotrauma.MapEntity.

Definition at line 255 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ IsVisible()

override bool Barotrauma.Gap.IsVisible ( Rectangle  worldView)
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 21 of file BarotraumaClient/ClientSource/Map/Gap.cs.

◆ Load()

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

Definition at line 830 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ Move()

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

Reimplemented from Barotrauma.MapEntity.

Definition at line 225 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ OnMapLoaded()

override void Barotrauma.Gap.OnMapLoaded ( )
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 825 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ RefreshOutsideCollider()

bool Barotrauma.Gap.RefreshOutsideCollider ( )

Definition at line 674 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ Remove()

override void Barotrauma.Gap.Remove ( )
virtual

Reimplemented from Barotrauma.Entity.

Definition at line 808 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ Save()

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

Reimplemented from Barotrauma.MapEntity.

Definition at line 864 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ ShallowRemove()

override void Barotrauma.Gap.ShallowRemove ( )
virtual

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

Reimplemented from Barotrauma.MapEntity.

Definition at line 797 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ Update()

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

Reimplemented from Barotrauma.MapEntity.

Definition at line 348 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ UpdateEditing()

override void Barotrauma.Gap.UpdateEditing ( Camera  cam,
float  deltaTime 
)
virtual

Reimplemented from Barotrauma.MapEntity.

Definition at line 325 of file BarotraumaClient/ClientSource/Map/Gap.cs.

◆ UpdateHulls()

static void Barotrauma.Gap.UpdateHulls ( )
static

Definition at line 238 of file BarotraumaShared/SharedSource/Map/Gap.cs.

Member Data Documentation

◆ ConnectedWall

Structure Barotrauma.Gap.ConnectedWall

Definition at line 129 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ DisableHullRechecks

bool Barotrauma.Gap.DisableHullRechecks

Definition at line 53 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ GapList

List<Gap> Barotrauma.Gap.GapList = new List<Gap>()
static

Definition at line 15 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ GlowEffectT

readonly float Barotrauma.Gap.GlowEffectT

Definition at line 36 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ PassAmbientLight

bool Barotrauma.Gap.PassAmbientLight

Definition at line 56 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ properties

readonly Dictionary<Identifier, SerializableProperty> Barotrauma.Gap.properties

Definition at line 165 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ ShowGaps

bool Barotrauma.Gap.ShowGaps = true
static

Definition at line 19 of file BarotraumaShared/SharedSource/Map/Gap.cs.

Property Documentation

◆ ConnectedDoor

Door Barotrauma.Gap.ConnectedDoor
getset

Definition at line 116 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ FlowTargetHull

Hull Barotrauma.Gap.FlowTargetHull
get

Definition at line 136 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ IsDiagonal

bool Barotrauma.Gap.IsDiagonal
get

"Diagonal" gaps are used on sloped walls to allow characters to pass through them either horizontally or vertically. Water still flows through them only horizontally or vertically

Definition at line 34 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ IsHorizontal

bool Barotrauma.Gap.IsHorizontal
get

Definition at line 24 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ IsRoomToRoom

bool Barotrauma.Gap.IsRoomToRoom
get

Definition at line 141 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ LerpedFlowForce

Vector2 Barotrauma.Gap.LerpedFlowForce
get

Definition at line 131 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ Name

override string Barotrauma.Gap.Name
get

Definition at line 163 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ Open

float Barotrauma.Gap.Open
getset

Definition at line 65 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ PressureDistributionSpeed

float Barotrauma.Gap.PressureDistributionSpeed
get

Definition at line 113 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ Rect

override Rectangle Barotrauma.Gap.Rect
getset

Definition at line 149 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ SelectableInEditor

override bool Barotrauma.Gap.SelectableInEditor
get

Definition at line 13 of file BarotraumaClient/ClientSource/Map/Gap.cs.

◆ SerializableProperties

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

Definition at line 166 of file BarotraumaShared/SharedSource/Map/Gap.cs.

◆ Size

float Barotrauma.Gap.Size
get

Definition at line 111 of file BarotraumaShared/SharedSource/Map/Gap.cs.