コード例 #1
0
        /// <summary>
        /// This method will set up the KAC object and wrap all the methods/functions
        /// </summary>
        /// <param name="Force">This option will force the Init function to rebind everything</param>
        /// <returns></returns>
        public static Boolean InitKERWrapper()
        {
            //if (!_KACWrapped )
            //{
            //reset the internal objects
            _KERWrapped = false;
            actualKER = null;
            KER = null;
            LogFormatted("Attempting to Grab KER Types...");

            //find the base type
            KERManoeuvreProcessorType = AssemblyLoader.loadedAssemblies
                .Select(a => a.assembly.GetExportedTypes())
                .SelectMany(t => t)
                .FirstOrDefault(t => t.FullName == "KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode.ManoeuvreProcessor");

            if (KERManoeuvreProcessorType == null)
            {
                return false;
            }

            LogFormatted("KER Version:{0}", KERManoeuvreProcessorType.Assembly.GetName().Version.ToString());

            LogFormatted("Creating Wrapper Objects");
            KER = new KERAPI(actualKER);
            //}
            _KERWrapped = true;
            return true;
        }
コード例 #2
0
        /// <summary>
        /// This method will set up the KAC object and wrap all the methods/functions
        /// </summary>
        /// <param name="Force">This option will force the Init function to rebind everything</param>
        /// <returns></returns>
        public static Boolean InitKERWrapper()
        {
            //if (!_KACWrapped )
            //{
            //reset the internal objects
            _KERWrapped = false;
            actualKER   = null;
            KER         = null;
            LogFormatted("Attempting to Grab KER Types...");


            //find the base type
            KERManoeuvreProcessorType = AssemblyLoader.loadedAssemblies
                                        .Select(a => a.assembly.GetExportedTypes())
                                        .SelectMany(t => t)
                                        .FirstOrDefault(t => t.FullName == "KerbalEngineer.Flight.Readouts.Orbital.ManoeuvreNode.ManoeuvreProcessor");

            if (KERManoeuvreProcessorType == null)
            {
                return(false);
            }

            LogFormatted("KER Version:{0}", KERManoeuvreProcessorType.Assembly.GetName().Version.ToString());


            LogFormatted("Creating Wrapper Objects");
            KER = new KERAPI(actualKER);
            //}
            _KERWrapped = true;
            return(true);
        }