‪GamecraftModdingAPI  ‪v1.8.0
‪The unofficial Gamecraft modding API
GamecraftModdingAPI.Blocks.Wire Class Reference

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 from an 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
 

Package Functions

 Wire (WireEntityStruct wire, SignalingBlock src, SignalingBlock dest)
 

Static Package Functions

static void Init ()
 

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...
 
float Float [get, set]
 ‪The wire's signal value, as a float. More...
 
EGID Id [get]
 ‪The wire's in-game id. More...
 
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 String [get, set]
 ‪The wire's string signal. More...
 

Constructor & Destructor Documentation

◆ Wire() [1/4]

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

‪Construct a wire object from an 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/4]

GamecraftModdingAPI.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/4]

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

‪Construct a wire object from an existing wire connection.

Parameters
wireEgid‪The wire ID.

◆ Wire() [4/4]

GamecraftModdingAPI.Blocks.Wire.Wire ( WireEntityStruct  wire,
SignalingBlock  src,
SignalingBlock  dest 
)
inlinepackage

Member Function Documentation

◆ Connect()

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

◆ ConnectedToInputPort()

static Wire GamecraftModdingAPI.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 GamecraftModdingAPI.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.

◆ Init()

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

◆ OutputToInputCopy()

Wire GamecraftModdingAPI.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 GamecraftModdingAPI.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 GamecraftModdingAPI.Blocks.Wire.ToString ( )
inline

Member Data Documentation

◆ endBlockEGID

EGID GamecraftModdingAPI.Blocks.Wire.endBlockEGID
protected

◆ endPort

byte GamecraftModdingAPI.Blocks.Wire.endPort
protected

◆ endPortEGID

EGID GamecraftModdingAPI.Blocks.Wire.endPortEGID
protected

◆ inputToOutput

bool GamecraftModdingAPI.Blocks.Wire.inputToOutput
protected

◆ signalEngine

SignalEngine GamecraftModdingAPI.Blocks.Wire.signalEngine
staticpackage

◆ startBlockEGID

EGID GamecraftModdingAPI.Blocks.Wire.startBlockEGID
protected

◆ startPort

byte GamecraftModdingAPI.Blocks.Wire.startPort
protected

◆ startPortEGID

EGID GamecraftModdingAPI.Blocks.Wire.startPortEGID
protected

◆ wireEGID

EGID GamecraftModdingAPI.Blocks.Wire.wireEGID
protected

Property Documentation

◆ ECSString

ECSString GamecraftModdingAPI.Blocks.Wire.ECSString
getset

‪The wire's raw string signal.

◆ End

SignalingBlock GamecraftModdingAPI.Blocks.Wire.End
get

‪The block at the end of the wire.

◆ EndPort

byte GamecraftModdingAPI.Blocks.Wire.EndPort
get

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

◆ Float

float GamecraftModdingAPI.Blocks.Wire.Float
getset

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

◆ Id

EGID GamecraftModdingAPI.Blocks.Wire.Id
get

‪The wire's in-game id.

◆ SignalId

uint GamecraftModdingAPI.Blocks.Wire.SignalId
getset

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

◆ Start

SignalingBlock GamecraftModdingAPI.Blocks.Wire.Start
get

‪The block at the beginning of the wire.

◆ StartPort

byte GamecraftModdingAPI.Blocks.Wire.StartPort
get

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

◆ String

string GamecraftModdingAPI.Blocks.Wire.String
getset

‪The wire's string signal.


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