コード例 #1
0
 public bool IsCompatibleWith(PortDescription otherPortDescription)
 {
     return(otherPortDescription != null &&
            otherPortDescription.Owner != Owner &&
            otherPortDescription.isInputSlot != isInputSlot &&
            ((isInputSlot
                ? otherPortDescription.IsCompatibleWithInputSlotType(ValueType)
                : IsCompatibleWithInputSlotType(otherPortDescription.ValueType))));
 }
コード例 #2
0
 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");
     }
 }
コード例 #3
0
        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);
        }
コード例 #4
0
ファイル: PortView.cs プロジェクト: GilbertoBitt/GTLogicGraph
        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);
        }