Exemple #1
0
        /// <summary>
        /// Uses the internal method for conducting an experiment; the experiment cannot be forced and must first pass the "canConduct". All associated animations and other functions will be called. Optinally run the experiment without opening the results window.
        /// </summary>
        /// <param name="isc">The science experiment module must be cast as an IScienceDataContianer.</param>
        /// <param name="silent">Set to true to prevent the science results dialog from opening.</param>
        /// <returns>Returns true if the science module is of the right type and the gather science method is called.</returns>
        public static bool deployDMExperiment(IScienceDataContainer isc, bool silent = false)
        {
            if (isc == null)
            {
                return(false);
            }

            Type t = isc.GetType();

            if (t == typeof(DMAnomalyScanner))
            {
                DMAnomalyScanner DMMod = (DMAnomalyScanner)isc;
                DMMod.gatherScienceData(silent);
                return(true);
            }
            else if (t == typeof(DMBioDrill))
            {
                DMBioDrill DMMod = (DMBioDrill)isc;
                DMMod.gatherScienceData(silent);
                return(true);
            }
            else if (t.IsSubclassOf(typeof(DMModuleScienceAnimate)))
            {
                DMModuleScienceAnimate DMMod = (DMModuleScienceAnimate)isc;
                DMMod.gatherScienceData(silent);
                return(true);
            }
            else if (t == typeof(DMModuleScienceAnimate))
            {
                DMModuleScienceAnimate DMMod = (DMModuleScienceAnimate)isc;
                DMMod.gatherScienceData(silent);
                return(true);
            }
            else if (t == typeof(DMSeismicHammer))
            {
                DMSeismicHammer DMMod = (DMSeismicHammer)isc;
                DMMod.gatherScienceData(silent);
                return(true);
            }
            else if (t == typeof(DMSeismicSensor))
            {
                DMSeismicSensor DMMod = (DMSeismicSensor)isc;
                DMMod.gatherScienceData(silent);
                return(true);
            }
            else if (t == typeof(DMAsteroidScanner))
            {
                DMAsteroidScanner DMMod = (DMAsteroidScanner)isc;
                DMMod.gatherScienceData(silent);
                return(true);
            }

            return(false);
        }