AkaCore.AkaLib.Evade.Collisions.FastPrediction C# (CSharp) Метод

FastPrediction() приватный статический Метод

private static FastPrediction ( System.Vector2 from, Obj_AI_Base unit, int delay, int speed ) : FastPredResult
from System.Vector2
unit Obj_AI_Base
delay int
speed int
Результат FastPredResult
        private static FastPredResult FastPrediction(Vector2 from, Obj_AI_Base unit, int delay, int speed)
        {
            var d = (delay / 1000f + (from.Distance(unit) / speed)) * unit.MoveSpeed;
            var path = unit.GetWaypoints();
            return path.PathLength() > d
                       ? new FastPredResult
                       {
                           IsMoving = true,
                           CurrentPos = unit.ServerPosition.To2D(),
                           PredictedPos = path.CutPath((int)d)[0]
                       }
                       : (path.Count == 0
                              ? new FastPredResult
                              {
                                  IsMoving = false,
                                  CurrentPos = unit.ServerPosition.To2D(),
                                  PredictedPos = unit.ServerPosition.To2D()
                              }
                              : new FastPredResult
                              {
                                  IsMoving = false,
                                  CurrentPos = path[path.Count - 1],
                                  PredictedPos = path[path.Count - 1]
                              });
        }