示例#1
0
文件: Skillshot.cs 项目: CONANLXF/AIO
 public SafePathResult(bool isSafe, FoundIntersection intersection)
 {
     this.IsSafe = isSafe;
     this.Intersection = intersection;
 }
示例#2
0
 public SafePathResult(bool isSafe, FoundIntersection intersection)
 {
     this.IsSafe       = isSafe;
     this.Intersection = intersection;
 }
示例#3
0
 public static SafePathResult IsSafePath(List<Vector2> path, int timeOffset, int speed = -1, int delay = 0)
 {
     var isSafe = true;
     var intersections = new List<FoundIntersection>();
     var intersection = new FoundIntersection();
     foreach (var sResult in
         from skillshot in DetectedSkillshots
         where skillshot.Enable
         select skillshot.IsSafePath(path, timeOffset, speed, delay))
     {
         isSafe = isSafe && sResult.IsSafe;
         if (sResult.Intersection.Valid)
         {
             intersections.Add(sResult.Intersection);
         }
     }
     if (isSafe)
     {
         return new SafePathResult(true, intersection);
     }
     var intersetion = intersections.MinOrDefault(i => i.Distance);
     return new SafePathResult(false, intersetion.Valid ? intersetion : intersection);
 }
示例#4
0
 public static SafePathResult IsSafePath(List<Vector2> path, int timeOffset, int speed = -1, int delay = 0)
 {
     var isSafe = true;
     var intersections = new List<FoundIntersection>();
     var intersection = new FoundIntersection();
     foreach (var sResult in
         Evade.DetectedSkillshots.Where(i => i.Evade).Select(i => i.IsSafePath(path, timeOffset, speed, delay)))
     {
         isSafe = isSafe && sResult.IsSafe;
         if (sResult.Intersection.Valid)
         {
             intersections.Add(sResult.Intersection);
         }
     }
     if (isSafe)
     {
         return new SafePathResult(true, intersection);
     }
     var sortedList = intersections.OrderBy(o => o.Distance).ToList();
     return new SafePathResult(false, sortedList.Count > 0 ? sortedList[0] : intersection);
 }