InputPort
InputPort
Overview needed
Constructor
public InputPort
new InputPort(parent)
Constructs the input port with no connections.
Parameters
-
parent: DigitalComponent
– The parent component of the port.
Properties
No publicly accessible properties on InputPort
protected parent: DigitalComponent
Description needed
protected connections: DigitalWire[]
Description needed
Methods
public activate
activate(signal) => void
Activates the port and propagates the signal to all connections.
Parameters
-
signal: false | true
– The signal to be propagated.
public connect
connect(wire) => void
Connects the input wire to the port if the wire is not already connected.
Parameters
-
wire: DigitalWire
– The new input wire.
public disconnect
disconnect() => void
Disconnects the input port from the input wire and changes the signal.
public getInput
getInput() => DigitalWire
Gets the input wire of the port.
Returns
-
DigitalWire
– The input wire.
public getInitialDir
getInitialDir() => Vector
Gets initial direction of the input port as a vector. Value is -1 because it's an input port (facing left).
Returns
-
Vector
– A vector that represents the direction of the input port.
public getParent
getParent() => DigitalComponent
Gets the parent component of the port.
Returns
-
DigitalComponent
– The parent component.
public getWires
getWires() => DigitalWire[]
Gets all the wires the port is connected to.
Returns
-
DigitalWire[]
– The wire connections.
Static Methods
No static methods for InputPort