예제 #1
0
 /// <summary>
 /// Gets the direction to be followed in the given step.
 /// </summary>
 /// <param name="stepIdx">The index of the step.</param>
 /// <returns>The direction to be followed in the given step.</returns>
 public int GetStepDirection(int stepIdx)
 {
     if (stepIdx < 0)
     {
         throw new IndexOutOfRangeException(string.Format("The requested step index '{0}' shall be greater than 0!"));
     }
     if (stepIdx >= this.CalculatedStepCount)
     {
         throw new IndexOutOfRangeException(string.Format("The requested step index '{0}' exceeds the number of calculated steps on this path!"));
     }
     return(GridDirections.VECTOR_TO_DIRECTION(this.lowLevelPath[stepIdx + 1].Coords - this.lowLevelPath[stepIdx].Coords));
 }