예제 #1
0
 protected override bool can_restore(PackedVessel v)
 {
     if (v == null || !base.can_restore(v))
     {
         return(false);
     }
     if (!SpawnManager.MetricFits(v.metric, v.GetSpawnRotation()))
     {
         Utils.Message(6, "Vessel clearance is insufficient for safe launch.\n\n" +
                       "\"{0}\" cannot be launched", v.name);
         return(false);
     }
     return(true);
 }
예제 #2
0
        protected override bool can_store_packed_vessel(PackedVessel vsl, bool in_flight)
        {
            if (!base.can_store_packed_vessel(vsl, in_flight))
            {
                return(false);
            }
            Quaternion?rotation = AutoPositionVessel && !in_flight
                ? SpawnManager.GetOptimalRotation(vsl.size)
                : vsl.GetSpawnRotation();

            if (!SpawnManager.MetricFits(vsl.metric, rotation))
            {
                Utils.Message(5, "Insufficient vessel clearance in hangar entrance\n" +
                              "\"{0}\" cannot be stored", vsl.name);
                return(false);
            }
            return(true);
        }
예제 #3
0
 public bool VesselFits(PackedVessel pv, bool in_optimal_orientation)
 {
     if (pv != null)
     {
         Quaternion?rotation = in_optimal_orientation
             ? SpawnManager.GetOptimalRotation(pv.size)
             : pv.GetSpawnRotation();
         if (SpawnManager.MetricFits(pv.metric, rotation))
         {
             var constraints = FitConstraint.GetInvocationList();
             for (int i = 0, len = constraints.Length; i < len; i++)
             {
                 if (constraints[i] is PackedVesselConstraint cons && !cons(pv))
                 {
                     return(false);
                 }
             }
             return(true);
         }
     }
     return(false);
 }