Exemplo n.º 1
0
    /// <summary>
    /// Create a new point and add it to the list.
    /// </summary>
    /// <param name="GPSposition"></param>
    /// <param name="dateTime"></param>
    public void CreatePoint(Vector2 GPSposition, DateTime dateTime, float actualDistance)
    {
        GPSPoint newPoint = new GPSPoint(GPSposition, dateTime);

        newPoint.Reposition();

        if (points.Count > 0)
        {
            if (actualDistance == -1f)
            {
                newPoint.actualDistance = GetDistance(newPoint.GetGPSPosition(), points[points.Count - 1].GetGPSPosition());
            }
            else
            {
                newPoint.actualDistance = actualDistance;
            }
            points[points.Count - 1].SetNext(newPoint);
        }
        points.Add(newPoint);
        TrunkatePoints();
    }