Example #1
0
 private static SafePathResult IsSafePath(List<Vector2> path, int timeOffset, int speed = -1, int delay = 0)
 {
     var isSafe = false;
     var intersections = new List<FoundIntersection>();
     var intersection = new FoundIntersection();
     foreach (var sResult in
         SkillshotDetector.DetectedSkillshots.Where(i => i.Evade)
             .Select(i => i.IsSafePath(path, timeOffset, speed, delay)))
     {
         isSafe = sResult.IsSafe;
         if (sResult.Intersection.Valid)
         {
             intersections.Add(sResult.Intersection);
         }
     }
     return isSafe
                ? new SafePathResult(true, intersection)
                : new SafePathResult(
                      false,
                      intersections.Count > 0 ? intersections.MinOrDefault(i => i.Distance) : intersection);
 }
Example #2
0
 public SafePathResult(bool isSafe, FoundIntersection intersection)
 {
     this.IsSafe       = isSafe;
     this.Intersection = intersection;
 }
Example #3
0
 public SafePathResult(bool isSafe, FoundIntersection intersection)
 {
     Intersection = intersection;
     IsSafe = isSafe;
 }
Example #4
0
 public SafePathResult(bool isSafe, FoundIntersection intersection)
 {
     this.IsSafe = isSafe;
     this.Intersection = intersection;
 }