public void CheckPoint(RegionPoint point, Region region, SectorElementCollection sectorElements, IEventLogger events)
 {
     if (!RoutePointValidator.ValidatePoint(point.Point, sectorElements))
     {
         string message = $"Invalid waypoint {point.Point} on region {region.Name}";
         events.AddEvent(
             new ValidationRuleFailure(message, region)
             );
     }
 }
 public void Validate(SectorElementCollection sectorElements, CompilerArguments args, IEventLogger events)
 {
     foreach (SidStar sidStar in sectorElements.SidStars)
     {
         foreach (string waypoint in sidStar.Route)
         {
             if (!RoutePointValidator.ValidateEseSidStarPoint(waypoint, sectorElements))
             {
                 string message =
                     $"Invalid waypoint {waypoint} on {sidStar.Type} {sidStar.Airport}/{sidStar.Identifier}";
                 events.AddEvent(
                     new ValidationRuleFailure(message, sidStar)
                     );
             }
         }
     }
 }
Ejemplo n.º 3
0
 public void Validate(SectorElementCollection sectorElements, CompilerArguments args, IEventLogger events)
 {
     foreach (SidStarRoute star in sectorElements.StarRoutes)
     {
         foreach (RouteSegment segment in star.Segments)
         {
             if (
                 !RoutePointValidator.ValidatePoint(segment.Start, sectorElements) ||
                 !RoutePointValidator.ValidatePoint(segment.End, sectorElements)
                 )
             {
                 string message =
                     $"Invalid segment {segment.GetCompileData(sectorElements)} on SID Route {star.Identifier}";
                 events.AddEvent(
                     new ValidationRuleFailure(message, segment)
                     );
             }
         }
     }
 }
 private static bool PointsValid(Point point1, Point point2, SectorElementCollection sectorElements)
 {
     return(RoutePointValidator.ValidatePoint(point1, sectorElements) &&
            RoutePointValidator.ValidatePoint(point2, sectorElements));
 }