public PathfinderConnection(PathfinderConnection SourceConnection)
        {
            NodeA = SourceConnection.NodeA.ParentNode;
            NodeB = SourceConnection.NodeB.ParentNode;
            NodeA.Connection_Add(this, ref NodeA_ConnectionNum);
            NodeB.Connection_Add(this, ref NodeB_ConnectionNum);

            NodeA.Layer.Connection_Add(this);
            ValueCalc();
        }
Example #2
0
 public void Connection_Add(PathfinderConnection NewConnection)
 {
     if ( Connections.GetUpperBound(0) < ConnectionCount )
     {
         Array.Resize(ref Connections, (ConnectionCount + 1) * 2);
     }
     Connections[ConnectionCount] = NewConnection;
     Connections[ConnectionCount].Layer_ConnectionNum = ConnectionCount;
     ConnectionCount++;
 }
Example #3
0
        public void Connection_Add(PathfinderConnection Connection, ref int OutputNum)
        {
            OutputNum = ConnectionCount;

            if ( Connections.GetUpperBound(0) < ConnectionCount )
            {
                Array.Resize(ref Connections, ConnectionCount * 2 + 1 + 1);
            }
            Connections[ConnectionCount] = Connection;
            ConnectionCount++;

            if ( ParentNode == null )
            {
                Layer.Network.FindParentNode_Add(this);
            }
        }
 public void UnlinkParentDependants()
 {
     if ( DependantConnection != null )
     {
         var tmpConnection = DependantConnection;
         DependantConnection = null;
         tmpConnection.LinkDecrease();
     }
 }
        public void RaiseDependant()
        {
            var tmpConnectionA = default(PathfinderConnection);

            if ( DependantConnection != null )
            {
                return;
            }

            if ( NodeA.ParentNode != NodeB.ParentNode )
            {
                if ( NodeA.ParentNode != null && NodeB.ParentNode != null )
                {
                    tmpConnectionA = NodeA.ParentNode.FindConnection(NodeB.ParentNode);
                    if ( tmpConnectionA == null )
                    {
                        DependantConnection = new PathfinderConnection(this);
                        DependantConnection.LinkIncrease();
                        DependantConnection.RaiseDependant();
                    }
                    else
                    {
                        DependantConnection = tmpConnectionA;
                        DependantConnection.LinkIncrease();
                    }
                }
            }
        }
 public void ForceDeallocate()
 {
     DependantConnection = null;
     NodeA = null;
     NodeB = null;
 }