Exemplo n.º 1
0
        private void ValidateFirstWpt(int index)
        {
            if (index == -1)
            {
                if (TryParseCoord(routeInput[0]))
                {
                    return;
                }

                throw new ArgumentException($"{routeInput[0]} is not a valid coordinate.");
            }

            if (!wptList.WaypointExists(index))
            {
                throw new ArgumentException("Wrong first waypoint index.");
            }

            var wpt = wptList[index];

            if (routeInput[0] != wpt.ID)
            {
                throw new ArgumentException(
                          "The first waypoint of the route does not match the " +
                          "specified index in WptList.");
            }

            lastWpt = index;
            rte.AddLastWaypoint(wpt);
        }