public bool IsCompatibleWith(PortDescription otherPortDescription) { return(otherPortDescription != null && otherPortDescription.Owner != Owner && otherPortDescription.isInputSlot != isInputSlot && ((isInputSlot ? otherPortDescription.IsCompatibleWithInputSlotType(ValueType) : IsCompatibleWithInputSlotType(otherPortDescription.ValueType)))); }
private void GetSlots(Edge edge, out PortDescription leftPortDescription, out PortDescription rightPortDescription) { leftPortDescription = (edge.output as PortView).PortDescription; rightPortDescription = (edge.input as PortView).PortDescription; if (leftPortDescription == null || rightPortDescription == null) { Debug.Log("an edge is null"); } }
public void AddSlot(PortDescription portDescription) { if (!(portDescription is PortDescription)) { throw new ArgumentException(string.Format( "Trying to add slot {0} to Material node {1}, but it is not a {2}", portDescription, this, typeof(PortDescription))); } _portDescriptions.Add(portDescription); }
public static Port Create(PortDescription portDescription, IEdgeConnectorListener connectorListener) { var port = new PortView(Orientation.Horizontal, portDescription.isInputSlot ? Direction.Input : Direction.Output, portDescription.isInputSlot ? Capacity.Single : Capacity.Multi, null) { m_EdgeConnector = new EdgeConnector <Edge>(connectorListener), }; port.AddManipulator(port.m_EdgeConnector); port.PortDescription = portDescription; return(port); }