Example #1
0
 private List<WaypointsInfo> GetClosestWPList(int WPNO, int Course, int WPRange, int FinishWaypoint)
 {
     List<WaypointsInfo> Result = new List<WaypointsInfo>();
     MainForm.WayPoints WP = new MainForm.WayPoints();
     WP.X = WowControl.WP[WPNO].X; WP.Y = WowControl.WP[WPNO].Y; WP.Z = WowControl.WP[WPNO].Z;
     for (int i = 0; i < WowControl.WP.Length; i++)
     {
         double Range = WowControl.CheckPoint(WowControl.WP[i].X, WowControl.WP[i].Y, WowControl.WP[i].Z, WP.X, WP.Y, WP.Z);
         if ((Range < WPRange) & (WaypointAlreadyInCourse(i, Course) == false))
         {
             WaypointsInfo Temp = new WaypointsInfo();
             Temp.Index = i;
             Temp.Range = Range;
             Result.Add(Temp);
         }
     }
     Result.Sort((a, b) => a.Range.CompareTo(b.Range));
     return Result;
 }
Example #2
0
 private void CalculateCourses()
 {
     for (int i = 0; i < Courses.Count; i++)
     {
         if (CourseIsBad(i) == false)
         {
             int CourseLenght = 0;
             for (int c = 0; c < Courses[i].Count; c++)
             {
                 if (c < Courses[i].Count - 1)
                     CourseLenght += (int)WowControl.CheckPoint(WowControl.WP[Courses[i][c]].X, WowControl.WP[Courses[i][c]].Y, WowControl.WP[Courses[i][c]].Z, WowControl.WP[Courses[i][c + 1]].X, WowControl.WP[Courses[i][c + 1]].Y, WowControl.WP[Courses[i][c + 1]].Z);
             }
             WaypointsInfo Temp = new WaypointsInfo();
             Temp.Index = i;
             Temp.Range = CourseLenght;
             CalculatedCourses.Add(Temp);
         }
     }
 }