‪TechbloxModdingAPI  ‪v2.2.0
‪The unofficial Techblox modding API
TechbloxModdingAPI.Blocks.Wire Class Reference
Inheritance diagram for TechbloxModdingAPI.Blocks.Wire:
TechbloxModdingAPI.EcsObjectBase

Public Member Functions

 Wire (Block start, Block end, byte startPort, byte endPort, EGID wire, bool inputToOutput)
 ‪Construct a wire object from an existing wire connection. More...
 
 Wire (Block start, Block end, byte startPort=Byte.MaxValue, byte endPort=Byte.MaxValue)
 ‪Construct a wire object froam n existing connection. More...
 
 Wire (EGID wireEgid)
 ‪Construct a wire object from an existing wire connection. More...
 
Wire OutputToInputCopy ()
 ‪Create a copy of the wire object where the direction of the wire is guaranteed to be from a block output to a block input. This is simply a different memory configuration and does not affect the in-game wire (which is always output -> input). More...
 
void OutputToInputInPlace ()
 ‪Convert the wire object to the direction the signal flows. Signals on wires always flow from a block output port to a block input port. This is simply a different memory configuration and does not affect the in-game wire (which is always output -> input). More...
 
override string ToString ()
 

Static Public Member Functions

static Wire Connect (SignalingBlock start, byte startPort, SignalingBlock end, byte endPort)
 
static Wire ConnectedToInputPort (SignalingBlock end, byte endPort)
 ‪An existing wire connection ending at the specified input. If multiple exist, this will return the first one found. More...
 
static Wire ConnectedToOutputPort (SignalingBlock start, byte startPort)
 ‪An existing wire connection starting at the specified output. If multiple exist, this will return the first one found. More...
 

Protected Attributes

EGID endBlockEGID
 
byte endPort
 
EGID endPortEGID
 
bool inputToOutput
 
EGID startBlockEGID
 
byte startPort
 
EGID startPortEGID
 
EGID wireEGID
 

Static Package Functions

static T GetInstance< T > (EGID egid, Func< EGID, T > constructor, Type type=null)
 ‪Returns a cached instance if there's an actively used instance of the object already. Objects still get garbage collected and then they will be removed from the cache. More...
 
static WeakDictionary< EGID, EcsObjectBaseGetInstances (Type type)
 
static void Init ()
 

Package Attributes

EcsInitData InitData
 

Static Package Attributes

static SignalEngine signalEngine
 

Properties

ECSString ECSString [get, set]
 ‪The wire's raw string signal. More...
 
SignalingBlock End [get]
 ‪The block at the end of the wire. More...
 
byte EndPort [get]
 ‪The port number that the end of the wire connects to. More...
 
string EndPortName [get]
 ‪The display name of the end port. More...
 
float Float [get, set]
 ‪The wire's signal value, as a float. More...
 
EGID Id [get]
 
uint SignalId [get, set]
 ‪The wire's signal id. I'm 50% sure this is useless. More...
 
SignalingBlock Start [get]
 ‪The block at the beginning of the wire. More...
 
byte StartPort [get]
 ‪The port number that the beginning of the wire connects to. More...
 
string StartPortName [get]
 ‪The display name of the start port. More...
 
string String [get, set]
 ‪The wire's string signal. More...
 

Constructor & Destructor Documentation

◆ Wire() [1/3]

TechbloxModdingAPI.Blocks.Wire.Wire ( Block  start,
Block  end,
byte  startPort = Byte.MaxValue,
byte  endPort = Byte.MaxValue 
)
inline

‪Construct a wire object froam n existing connection.

Parameters
start‪Starting block ID.
end‪Ending block ID.
startPort‪Starting port number, or guess if omitted.
endPort‪Ending port number, or guess if omitted.
Exceptions
WireInvalidException‪Guessing failed or wire does not exist.

◆ Wire() [2/3]

TechbloxModdingAPI.Blocks.Wire.Wire ( Block  start,
Block  end,
byte  startPort,
byte  endPort,
EGID  wire,
bool  inputToOutput 
)
inline

‪Construct a wire object from an existing wire connection.

Parameters
start‪Starting block ID.
end‪Ending block ID.
startPort‪Starting port number.
endPort‪Ending port number.
wire‪The wire ID.
inputToOutput‪Whether the wire direction goes input -> output (true) or output -> input (false, preferred).

◆ Wire() [3/3]

TechbloxModdingAPI.Blocks.Wire.Wire ( EGID  wireEgid)
inline

‪Construct a wire object from an existing wire connection.

Parameters
wireEgid‪The wire ID.

Member Function Documentation

◆ Connect()

static Wire TechbloxModdingAPI.Blocks.Wire.Connect ( SignalingBlock  start,
byte  startPort,
SignalingBlock  end,
byte  endPort 
)
inlinestatic

◆ ConnectedToInputPort()

static Wire TechbloxModdingAPI.Blocks.Wire.ConnectedToInputPort ( SignalingBlock  end,
byte  endPort 
)
inlinestatic

‪An existing wire connection ending at the specified input. If multiple exist, this will return the first one found.

Parameters
end‪Destination block.
endPort‪Port number.
Returns
‪The wire, where the end of the wire is the block port specified, or null if does not exist.

◆ ConnectedToOutputPort()

static Wire TechbloxModdingAPI.Blocks.Wire.ConnectedToOutputPort ( SignalingBlock  start,
byte  startPort 
)
inlinestatic

‪An existing wire connection starting at the specified output. If multiple exist, this will return the first one found.

Parameters
start‪Source block entity ID.
startPort‪Port number.
Returns
‪The wire, where the start of the wire is the block port specified, or null if does not exist.

◆ GetInstance< T >()

static T TechbloxModdingAPI.EcsObjectBase.GetInstance< T > ( EGID  egid,
Func< EGID, T >  constructor,
Type  type = null 
)
inlinestaticpackageinherited

‪Returns a cached instance if there's an actively used instance of the object already. Objects still get garbage collected and then they will be removed from the cache.

Parameters
egid‪The EGID of the entity
constructor‪The constructor to construct the object
Template Parameters
T‪The object type
Returns
Type Constraints
T :EcsObjectBase 

◆ GetInstances()

static WeakDictionary<EGID, EcsObjectBase> TechbloxModdingAPI.EcsObjectBase.GetInstances ( Type  type)
inlinestaticpackageinherited

◆ Init()

static void TechbloxModdingAPI.Blocks.Wire.Init ( )
inlinestaticpackage

◆ OutputToInputCopy()

Wire TechbloxModdingAPI.Blocks.Wire.OutputToInputCopy ( )
inline

‪Create a copy of the wire object where the direction of the wire is guaranteed to be from a block output to a block input. This is simply a different memory configuration and does not affect the in-game wire (which is always output -> input).

Returns
‪A copy of the wire object.

◆ OutputToInputInPlace()

void TechbloxModdingAPI.Blocks.Wire.OutputToInputInPlace ( )
inline

‪Convert the wire object to the direction the signal flows. Signals on wires always flow from a block output port to a block input port. This is simply a different memory configuration and does not affect the in-game wire (which is always output -> input).

◆ ToString()

override string TechbloxModdingAPI.Blocks.Wire.ToString ( )
inline

Member Data Documentation

◆ endBlockEGID

EGID TechbloxModdingAPI.Blocks.Wire.endBlockEGID
protected

◆ endPort

byte TechbloxModdingAPI.Blocks.Wire.endPort
protected

◆ endPortEGID

EGID TechbloxModdingAPI.Blocks.Wire.endPortEGID
protected

◆ InitData

EcsInitData TechbloxModdingAPI.EcsObjectBase.InitData
packageinherited

◆ inputToOutput

bool TechbloxModdingAPI.Blocks.Wire.inputToOutput
protected

◆ signalEngine

SignalEngine TechbloxModdingAPI.Blocks.Wire.signalEngine
staticpackage

◆ startBlockEGID

EGID TechbloxModdingAPI.Blocks.Wire.startBlockEGID
protected

◆ startPort

byte TechbloxModdingAPI.Blocks.Wire.startPort
protected

◆ startPortEGID

EGID TechbloxModdingAPI.Blocks.Wire.startPortEGID
protected

◆ wireEGID

EGID TechbloxModdingAPI.Blocks.Wire.wireEGID
protected

Property Documentation

◆ ECSString

ECSString TechbloxModdingAPI.Blocks.Wire.ECSString
getset

‪The wire's raw string signal.

◆ End

SignalingBlock TechbloxModdingAPI.Blocks.Wire.End
get

‪The block at the end of the wire.

◆ EndPort

byte TechbloxModdingAPI.Blocks.Wire.EndPort
get

‪The port number that the end of the wire connects to.

◆ EndPortName

string TechbloxModdingAPI.Blocks.Wire.EndPortName
get

‪The display name of the end port.

◆ Float

float TechbloxModdingAPI.Blocks.Wire.Float
getset

‪The wire's signal value, as a float.

◆ Id

EGID TechbloxModdingAPI.EcsObjectBase.Id
getinherited

◆ SignalId

uint TechbloxModdingAPI.Blocks.Wire.SignalId
getset

‪The wire's signal id. I'm 50% sure this is useless.

◆ Start

SignalingBlock TechbloxModdingAPI.Blocks.Wire.Start
get

‪The block at the beginning of the wire.

◆ StartPort

byte TechbloxModdingAPI.Blocks.Wire.StartPort
get

‪The port number that the beginning of the wire connects to.

◆ StartPortName

string TechbloxModdingAPI.Blocks.Wire.StartPortName
get

‪The display name of the start port.

◆ String

string TechbloxModdingAPI.Blocks.Wire.String
getset

‪The wire's string signal.


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