예제 #1
0
        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();
        }
예제 #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++;
 }
예제 #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);
            }
        }
예제 #4
0
 public void UnlinkParentDependants()
 {
     if ( DependantConnection != null )
     {
         var tmpConnection = DependantConnection;
         DependantConnection = null;
         tmpConnection.LinkDecrease();
     }
 }
예제 #5
0
        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();
                    }
                }
            }
        }
예제 #6
0
 public void ForceDeallocate()
 {
     DependantConnection = null;
     NodeA = null;
     NodeB = null;
 }