Exemplo n.º 1
0
 public Routeway BuildShortestRouteway(Architecture des, bool noWater)
 {
     Point? nullable;
     Point? nullable2;
     if (!noWater)
     {
         Point key = new Point(base.ID, des.ID);
         if (this.BelongedFaction.ClosedRouteways.ContainsKey(key))
         {
             return null;
         }
     }
     base.Scenario.GetClosestPointsBetweenTwoAreas(this.GetRoutewayStartPoints(), des.GetRoutewayStartPoints(), out nullable, out nullable2);
     if (nullable.HasValue && nullable2.HasValue)
     {
         this.BelongedFaction.RoutewayPathBuilder.MultipleWaterCost = noWater;
         if (this.BelongedFaction.RoutewayPathAvail(nullable.Value, nullable2.Value, true))
         {
             Routeway routeway = this.CreateRouteway(this.BelongedFaction.GetCurrentRoutewayPath());
             routeway.DestinationArchitecture = des;
             routeway.EndArchitecture = des;
             return routeway;
         }
         if (!noWater)
         {
             this.BelongedFaction.ClosedRouteways.Add(new Point(base.ID, des.ID), null);
         }
     }
     return null;
 }