Ejemplo n.º 1
0
 public DistanceConstraint(string[] args, IZoneResolver zoneResolver)
 {
     if (args.Length == 3)
     {
         _targetZone = zoneResolver.ResolveZone(args[0].Trim());
         if (!int.TryParse(args[2], out var v))
         {
             _test = _ => false;
         }
         else
         {
             var trimmed = args[1].Trim();
             _test = trimmed switch
             {
                 "<" => i => i <v,
                                ">" => i => i> v,
                 "=" => i => i == v,
                 _ => _ => false
             };
         }
     }
     else
     {
         _test = _ => false;
     }
 }
Ejemplo n.º 2
0
 public DistanceSelector(string[] args, IZoneResolver zoneResolver)
 {
     Target = zoneResolver.ResolveZone(args[0].Trim());
 }