/// <summary>
        /// Method to determine if the given vessel has been successfully voxelized nd currently has valid voxelization
        /// </summary>
        /// <param name="vessel"></param>
        /// <returns>True if vessel has valid voxelization currently, returns false if not or if the vessel is null and/or destroyed</returns>
        public static bool VesselVoxelizationCompletedAndValid(Vessel vessel)
        {
            if (vessel == null)
            {
                return(false);
            }

            FARVesselAero vesselAeroModule = null;

            for (int i = 0; i < vessel.vesselModules.Count; ++i)
            {
                VesselModule vM = vessel.vesselModules[i];
                if (vM is FARVesselAero)
                {
                    vesselAeroModule = (FARVesselAero)vM;
                    break;
                }
            }

            if ((object)vesselAeroModule == null)       //if this is true, then the vessel has not been initialized yet and so must be false
            {
                return(false);
            }

            return(vesselAeroModule.HasValidVoxelizationCurrently());
        }
Beispiel #2
0
        /// <summary>
        ///     Method to determine if the given vessel has been successfully voxelized nd currently has valid voxelization
        /// </summary>
        /// <param name="vessel"></param>
        /// <returns>
        ///     True if vessel has valid voxelization currently, returns false if not or if the vessel is null and/or
        ///     destroyed
        /// </returns>
        public static bool VesselVoxelizationCompletedAndValid(Vessel vessel)
        {
            if (vessel == null)
            {
                return(false);
            }

            FARVesselAero vesselAeroModule = null;

            foreach (VesselModule vM in vessel.vesselModules)
            {
                if (!(vM is FARVesselAero vesselAero))
                {
                    continue;
                }
                vesselAeroModule = vesselAero;
                break;
            }

            return(!(vesselAeroModule is null) && vesselAeroModule.HasValidVoxelizationCurrently());
        }