public List <TFlightPoint> GetFlightData()
 {
     if (this.trajectory == null || this.trajectory.Count == 0)
     {
         this.trajectory = TFlightData.GenerateMissingTrajectory(this);
     }
     return(this.trajectory);
 }
    private int PullMaxHeight()
    {
        if (this.trajectory.Count > 0)
        {
            return(this.PullMaxHeight(ref this.trajectory));
        }
        List <TFlightPoint> tFlightPoints = TFlightData.GenerateMissingTrajectory(this);

        return(this.PullMaxHeight(ref tFlightPoints));
    }
    public static TFlightTrajectory CalculateAverageTrajectory(IList <TFlightData> shotList, int maxPoints = 100)
    {
        List <Vector3> vector3s;
        TFlightPoint   tFlightPoint;
        List <List <TFlightPoint> > lists = new List <List <TFlightPoint> >();

        foreach (TFlightData tFlightDatum in shotList)
        {
            lists.Add(TFlightData.GenerateMissingTrajectory(tFlightDatum));
        }
        List <List <TFlightPoint> > lists1 = new List <List <TFlightPoint> >();
        List <List <TFlightPoint> > lists2 = new List <List <TFlightPoint> >();

        for (int i = 0; i < lists.Count; i++)
        {
            int num = lists[i].IndexOf(shotList[i].carryPoint);
            lists1.Add(lists[i].GetRange(0, num + 2));
            lists2.Add(lists[i].GetRange(num + 2, lists[i].Count - (num + 2)));
        }
        int num1 = lists1.Min <List <TFlightPoint> >((List <TFlightPoint> list) => list.Count);

        if (num1 > maxPoints)
        {
            num1 = maxPoints;
        }
        int num2 = lists2.Min <List <TFlightPoint> >((List <TFlightPoint> list) => list.Count);

        if (num2 > maxPoints)
        {
            num2 = maxPoints;
        }
        List <Vector3> vector3s1 = new List <Vector3>(new Vector3[num1]);
        List <Vector3> vector3s2 = new List <Vector3>(new Vector3[num2]);

        for (int j = 0; j < num1; j++)
        {
            for (int k = 0; k < lists1.Count; k++)
            {
                float          count = (float)lists1[k].Count / (float)num1;
                int            num3  = (int)((float)j * count);
                List <Vector3> item  = vector3s1;
                vector3s = item;
                int num4 = j;
                int num5 = num4;
                item[num4] = vector3s[num5] + lists1[k][num3].location;
            }
        }
        for (int l = 0; l < num2; l++)
        {
            for (int m = 0; m < lists2.Count; m++)
            {
                float          single = (float)lists2[m].Count / (float)num2;
                int            num6   = (int)((float)l * single);
                List <Vector3> item1  = vector3s2;
                vector3s = item1;
                int num7 = l;
                int num8 = num7;
                item1[num7] = vector3s[num8] + lists2[m][num6].location;
            }
        }
        List <TFlightPoint> tFlightPoints = new List <TFlightPoint>();

        for (int n = 0; n < vector3s1.Count; n++)
        {
            tFlightPoint = new TFlightPoint()
            {
                location = vector3s1[n] / (float)shotList.Count
            };
            tFlightPoints.Add(tFlightPoint);
        }
        List <TFlightPoint> tFlightPoints1 = new List <TFlightPoint>();

        for (int o = 0; o < vector3s2.Count; o++)
        {
            tFlightPoint = new TFlightPoint()
            {
                location = vector3s2[o] / (float)shotList.Count
            };
            tFlightPoints1.Add(tFlightPoint);
        }
        return(new TFlightTrajectory(tFlightPoints, tFlightPoints1));
    }