Beispiel #1
0
        public Point NextStep(Point point, double distance)
        {
            double LenghtToEndLink = point.Lenght(currentLink.NodeEnd.Coordinate);
            Point  ret;

            if (LenghtToEndLink > distance)
            {
                ret = StepLink(point, distance);
            }
            else
            {
                if (currentLink.NodeEnd != NodeEnd)
                {
                    distance   -= LenghtToEndLink;
                    currentLink = Links.FirstOrDefault(l => l.NodeStart == currentLink.NodeEnd);
                    ret         = NextStep(currentLink.NodeStart.Coordinate, distance);
                }
                else
                {
                    ret = NodeEnd.Coordinate;
                    OnEndedPath?.Invoke(this);
                }
            }
            return(ret);
        }
Beispiel #2
0
 public void RemovePath()
 {
     OnEndedPath?.Invoke(this);
 }