Пример #1
0
        public override void ClearConnections(bool alsoReverse)
        {
            if (alsoReverse)
            {
                GridGraph gg = GetGridGraph(GraphIndex);
                for (int i = 0; i < 8; i++)
                {
                    GridNode other = gg.GetNodeConnection(this, i);
                    if (other != null)
                    {
                        //Remove reverse connection
                        other.SetConnectionInternal(i < 4 ? ((i + 2) % 4) : (((5 - 2) % 4) + 4), false);
                    }
                }
            }

            ResetConnectionsInternal();

            if (alsoReverse)
            {
                if (connections != null)
                {
                    for (int i = 0; i < connections.Length; i++)
                    {
                        connections[i].RemoveConnection(this);
                    }
                }
            }
            connections     = null;
            connectionCosts = null;
        }
Пример #2
0
 public override void ClearConnections(bool alsoReverse)
 {
     if (alsoReverse)
     {
         GridGraph gridGraph = GridNode.GetGridGraph(base.GraphIndex);
         for (int i = 0; i < 8; i++)
         {
             GridNode nodeConnection = gridGraph.GetNodeConnection(this, i);
             if (nodeConnection != null)
             {
                 nodeConnection.SetConnectionInternal((i >= 4) ? 7 : ((i + 2) % 4), false);
             }
         }
     }
     this.ResetConnectionsInternal();
     if (alsoReverse && this.connections != null)
     {
         for (int j = 0; j < this.connections.Length; j++)
         {
             this.connections[j].RemoveConnection(this);
         }
     }
     this.connections     = null;
     this.connectionCosts = null;
 }
Пример #3
0
 public override void ClearConnections(bool alsoReverse)
 {
     if (alsoReverse)
     {
         GridGraph gridGraph = GetGridGraph(base.GraphIndex);
         for (int i = 0; i < 8; i++)
         {
             GridNode nodeConnection = gridGraph.GetNodeConnection(this, i);
             if (nodeConnection != null)
             {
                 nodeConnection.SetConnectionInternal((i >= 4) ? 7 : ((i + 2) % 4), false);
             }
         }
     }
     this.ResetConnectionsInternal();
 }
Пример #4
0
        public override void ClearConnections(bool alsoReverse)
        {
            if (alsoReverse)
            {
                GridGraph gg = GetGridGraph(GraphIndex);
                for (int i = 0; i < 8; i++)
                {
                    GridNode other = gg.GetNodeConnection(this, i);
                    if (other != null)
                    {
                        //Remove reverse connection
                        other.SetConnectionInternal(i < 4 ? ((i + 2) % 4) : (((5 - 2) % 4) + 4), false);
                    }
                }
            }

            ResetConnectionsInternal();

#if !ASTAR_GRID_NO_CUSTOM_CONNECTIONS
            base.ClearConnections(alsoReverse);
#endif
        }