/// <summary> /// This method will set up the KB LS object and wrap all the methods/functions /// </summary> /// <returns></returns> public static Boolean InitKBWrapper() { //reset the internal objects _KBWrapped = false; actualKB = null; LogFormatted_DebugOnly("Attempting to Grab KB LS Types..."); //find the base type KBType = getType("KERBALISM.API"); if (KBType == null) { return(false); } LogFormatted("KB LS Version:{0}", KBType.Assembly.GetName().Version.ToString()); //If we get this far we can set up the local object and its methods/functions LogFormatted_DebugOnly("Got Instance, Creating Wrapper Objects"); KBActualAPI = new KBAPI(); //KBIsKerbalTracked = new KBIsKerbalTrackedAPI(actualKBIsKerbalTracked); _KBWrapped = true; return(true); }
/// <summary> /// This method will set up the KB LS object and wrap all the methods/functions /// </summary> /// <returns></returns> public static Boolean InitKBWrapper() { //reset the internal objects _KBWrapped = false; actualKB = null; LogFormatted_DebugOnly("Attempting to Grab KB LS Types..."); //find the base type KBType = AssemblyLoader.loadedAssemblies .Select(a => a.assembly.GetExportedTypes()) .SelectMany(t => t) .FirstOrDefault(t => t.FullName == "KERBALISM.Kerbalism"); if (KBType == null) { return false; } LogFormatted("KB LS Version:{0}", KBType.Assembly.GetName().Version.ToString()); //If we get this far we can set up the local object and its methods/functions LogFormatted_DebugOnly("Got Instance, Creating Wrapper Objects"); KBActualAPI = new KBAPI(); //KBIsKerbalTracked = new KBIsKerbalTrackedAPI(actualKBIsKerbalTracked); _KBWrapped = true; return true; }