public void Connect() { if ((this.connectingFrom == null) || (this.connectingTo == null)) { throw new NullReferenceException("Terminals not specified correctly."); } if (!this.connectingFrom.TerminalsTo.Contains(this.connectingTo)) { this.connectingFrom.TerminalsTo.Add(this.connectingTo); this.connectingTo.TerminalsFrom.Add(this.connectingFrom); } this.connectingTo = null; this.connectingFrom = null; }
public Mechanic ConnectTo(IOnePinInput singleInputComponent) { this.connectingTo = singleInputComponent.PinA; return this; }
public Mechanic ConnectTo(InputTerminal terminal) { this.connectingTo = terminal; return this; }