Exemple #1
0
 /// <summary>
 /// Use for a 'step by step' search only. This method is alternate to SearchPath.
 /// Initializes AStar before performing search steps manually with NextStep.
 /// </summary>
 /// <exception cref="ArgumentNullException">StartNode and EndNode cannot be null.</exception>
 /// <param name="StartNode">The node from which the path must start.</param>
 /// <param name="EndNode">The node to which the path must end.</param>
 public void Initialize(SimWaypoint StartNode, SimWaypoint EndNode)
 {
     if (StartNode == null || EndNode == null)
     {
         throw new ArgumentNullException();
     }
     _Closed.Clear();
     _Open.Clear();
     Track.Target = EndNode;
     _Open.Add(new Track(StartNode));
     _NbIterations   = 0;
     _LeafToGoBackUp = null;
 }