Barotrauma Client Doc
Barotrauma.Items.Components.Connection Class Reference

Public Member Functions

override string ToString ()
 
 Connection (ContentXElement element, ConnectionPanel connectionPanel, IdRemap idRemap)
 
bool IsConnectedToSomething ()
 Checks if the the connection is connected to a wire or a circuit box connection More...
 
void SetRecipientsDirty ()
 
Wire FindWireByItem (Item it)
 
bool WireSlotsAvailable ()
 
bool TryAddLink (Wire wire)
 
void DisconnectWire (Wire wire)
 
void ConnectWire (Wire wire)
 
void SendSignal (Signal signal)
 
void ClearConnections ()
 
void InitializeFromLoaded ()
 
void Save (XElement parentElement)
 
void Flash (Color? color=null, float flashDuration=1.5f)
 
void UpdateFlashTimer (float deltaTime)
 

Static Public Member Functions

static void SendSignalIntoConnection (Signal signal, Connection conn)
 
static void DrawConnections (SpriteBatch spriteBatch, ConnectionPanel panel, Rectangle dragArea, Character character, out(Vector2 tooltipPos, LocalizedString text) tooltip)
 
static void DrawConnectionDebugInfo (SpriteBatch spriteBatch, Connection c, Vector2 position, float scale, out LocalizedString tooltip)
 
static bool CheckConnectionLabelOverlap (ConnectionPanel panel, out Point newRectSize)
 

Public Attributes

readonly int MaxPlayerConnectableWires = 5
 
readonly int MaxWires = 5
 
readonly string Name
 
readonly LocalizedString DisplayName
 
List< CircuitBoxConnection > CircuitBoxConnections = new()
 Circuit box input and output connections that are linked to this connection. More...
 
readonly bool IsOutput
 
readonly List< StatusEffectEffects
 
readonly List<(ushort wireId, int? connectionIndex)> LoadedWires
 
GridInfo Grid
 
PowerPriority Priority = PowerPriority.Default
 

Properties

IReadOnlyCollection< WireWires [get]
 
Signal LastSentSignal [get]
 
Signal LastReceivedSignal [get]
 
bool IsPower [get]
 
List< ConnectionRecipients [get]
 
Item Item [get]
 
ConnectionPanel ConnectionPanel [get]
 
float FlashTimer [get]
 
static Wire DraggingConnected [get]
 

Detailed Description

Constructor & Destructor Documentation

◆ Connection()

Barotrauma.Items.Components.Connection.Connection ( ContentXElement  element,
ConnectionPanel  connectionPanel,
IdRemap  idRemap 
)

Member Function Documentation

◆ CheckConnectionLabelOverlap()

static bool Barotrauma.Items.Components.Connection.CheckConnectionLabelOverlap ( ConnectionPanel  panel,
out Point  newRectSize 
)
static

◆ ClearConnections()

void Barotrauma.Items.Components.Connection.ClearConnections ( )

◆ ConnectWire()

void Barotrauma.Items.Components.Connection.ConnectWire ( Wire  wire)

◆ DisconnectWire()

void Barotrauma.Items.Components.Connection.DisconnectWire ( Wire  wire)

◆ DrawConnectionDebugInfo()

static void Barotrauma.Items.Components.Connection.DrawConnectionDebugInfo ( SpriteBatch  spriteBatch,
Connection  c,
Vector2  position,
float  scale,
out LocalizedString  tooltip 
)
static

◆ DrawConnections()

static void Barotrauma.Items.Components.Connection.DrawConnections ( SpriteBatch  spriteBatch,
ConnectionPanel  panel,
Rectangle  dragArea,
Character  character,
out(Vector2 tooltipPos, LocalizedString text)  tooltip 
)
static

◆ FindWireByItem()

Wire Barotrauma.Items.Components.Connection.FindWireByItem ( Item  it)

◆ Flash()

void Barotrauma.Items.Components.Connection.Flash ( Color?  color = null,
float  flashDuration = 1.5f 
)

◆ InitializeFromLoaded()

void Barotrauma.Items.Components.Connection.InitializeFromLoaded ( )

◆ IsConnectedToSomething()

bool Barotrauma.Items.Components.Connection.IsConnectedToSomething ( )

Checks if the the connection is connected to a wire or a circuit box connection

◆ Save()

void Barotrauma.Items.Components.Connection.Save ( XElement  parentElement)

◆ SendSignal()

void Barotrauma.Items.Components.Connection.SendSignal ( Signal  signal)

◆ SendSignalIntoConnection()

static void Barotrauma.Items.Components.Connection.SendSignalIntoConnection ( Signal  signal,
Connection  conn 
)
static

◆ SetRecipientsDirty()

void Barotrauma.Items.Components.Connection.SetRecipientsDirty ( )

◆ ToString()

override string Barotrauma.Items.Components.Connection.ToString ( )

◆ TryAddLink()

bool Barotrauma.Items.Components.Connection.TryAddLink ( Wire  wire)

◆ UpdateFlashTimer()

void Barotrauma.Items.Components.Connection.UpdateFlashTimer ( float  deltaTime)

◆ WireSlotsAvailable()

bool Barotrauma.Items.Components.Connection.WireSlotsAvailable ( )

Member Data Documentation

◆ CircuitBoxConnections

List<CircuitBoxConnection> Barotrauma.Items.Components.Connection.CircuitBoxConnections = new()

Circuit box input and output connections that are linked to this connection.

We don't want to create a wire between the circuit boxes connection panel and the connection panel of the item inside the circuit box so we use this to bridge the gap.

Definition at line 33 of file BarotraumaShared/SharedSource/Items/Components/Signal/Connection.cs.

◆ DisplayName

readonly LocalizedString Barotrauma.Items.Components.Connection.DisplayName

◆ Effects

readonly List<StatusEffect> Barotrauma.Items.Components.Connection.Effects

◆ Grid

GridInfo Barotrauma.Items.Components.Connection.Grid

◆ IsOutput

readonly bool Barotrauma.Items.Components.Connection.IsOutput

◆ LoadedWires

readonly List<(ushort wireId, int? connectionIndex)> Barotrauma.Items.Components.Connection.LoadedWires

◆ MaxPlayerConnectableWires

readonly int Barotrauma.Items.Components.Connection.MaxPlayerConnectableWires = 5

◆ MaxWires

readonly int Barotrauma.Items.Components.Connection.MaxWires = 5

◆ Name

readonly string Barotrauma.Items.Components.Connection.Name

◆ Priority

PowerPriority Barotrauma.Items.Components.Connection.Priority = PowerPriority.Default

Property Documentation

◆ ConnectionPanel

ConnectionPanel Barotrauma.Items.Components.Connection.ConnectionPanel
get

◆ DraggingConnected

Wire Barotrauma.Items.Components.Connection.DraggingConnected
staticget

◆ FlashTimer

float Barotrauma.Items.Components.Connection.FlashTimer
get

◆ IsPower

bool Barotrauma.Items.Components.Connection.IsPower
get

◆ Item

Item Barotrauma.Items.Components.Connection.Item
get

◆ LastReceivedSignal

Signal Barotrauma.Items.Components.Connection.LastReceivedSignal
get

◆ LastSentSignal

Signal Barotrauma.Items.Components.Connection.LastSentSignal
get

◆ Recipients

List<Connection> Barotrauma.Items.Components.Connection.Recipients
get

◆ Wires

IReadOnlyCollection<Wire> Barotrauma.Items.Components.Connection.Wires
get