Connect
ConnectionAction
ConnectionAction represents the action of connecting two ports with a wire.
Constructor
public ConnectionAction
new ConnectionAction(designer, w)
Initializes a ConnectionAction given the CircuitDesigner and a Wire.
Parameters
designer: CircuitDesigner
– The CircuitDesigner this action is being done on.w: Wire
– The Wire being connected.
new ConnectionAction(designer, p1, p2)
Initializes a ConnectionAction given the CircuitDesigner and two Ports.
Parameters
designer: CircuitDesigner
– The CircuitDesigner this action is being done on.p1: Port
– The first Port being connected.p2: Port
– The second Port being connected.
Properties
No publicly accessible properties on ConnectionAction
private designer: CircuitDesigner
Description needed
Methods
public normalExecute
normalExecute() => Action
Executes the ConnectionAction by creating the Wire and connecting it to the proper Ports.
Returns
-
Action
– 'this' ConnectionAction after execution.
public normalUndo
normalUndo() => Action
Undoes the ConnectionAction by removing the Wire and disconnecting it from the two Ports.
Returns
-
Action
– 'this' ConnectionAction after undoing.
public getWire
getWire() => Wire
Gets the Wire associated with this ConnectionAction.
Returns
-
Wire
– The Wire in this connection.
Static Methods
No static methods for ConnectionAction
Functions
Connect
Connect(designer, p1, p2) => ConnectionAction
Description needed
Parameters
designer: CircuitDesigner
– Description neededp1: Port
– Description neededp2: Port
– Description needed
Returns
-
ConnectionAction
– Description needed
Disconnect
Disconnect(designer, wire) => ConnectionAction
Description needed
Parameters
designer: CircuitDesigner
– Description neededwire: Wire
– Description needed
Returns
-
ConnectionAction
– Description needed
CreateGroupDisconnectAction
CreateGroupDisconnectAction(designer, wires) => GroupAction
Creates a GroupAction of DisconnectActions.
Parameters
designer: CircuitDesigner
– The CircuitDesigner the actions are done on.wires: Wire[]
– The Wires being disconnected.
Returns
-
GroupAction
– A GroupAction representing the DisconnectActions of each Wire.