public void Clear() { if (isOutput && !empty) { foreach (Connection c in OtherConnections.ToList()) c.Clear(); } else if (!empty) { point = null; OtherConnection.OtherConnections.Remove(this); OtherConnection.empty = OtherConnection.OtherConnections.Count == 0; } empty = true; }
public void ConnectTo(Connection connection) { if (!isOutput && !empty) { Clear(); } connection.empty = empty = false; if (isOutput) { OtherConnections.Add(connection); connection.OtherConnection = this; } else { connection.OtherConnections.Add(this); OtherConnection = connection; } }