Пример #1
0
        public EngineValue(global::Part part, MultiModeEngine engine, SharedObjects sharedObj)
            : base(part, sharedObj)
        {
            MMengine = engine;

            var moduleEngines = part.Modules.GetModules<ModuleEngines>();
            if (moduleEngines.Count == 2)
            {
                var modEngine1 = moduleEngines.Where(e => e.engineID == MMengine.primaryEngineID).FirstOrDefault();
                if (modEngine1 != null)
                    engine1 = new ModuleEngineAdapter(modEngine1);
                else
                    throw new KOSException("Attempted to build a MultiModeEngine with no engine matching Primary ID");
                var modEngine2 = moduleEngines.Where(e => e.engineID == MMengine.secondaryEngineID).FirstOrDefault();
                if (modEngine2 != null)
                    engine2 = new ModuleEngineAdapter(modEngine2);
                else
                    throw new KOSException("Attempted to build a MultiModeEngine with no engine matching Secondary ID");
            }
            else
            {
                throw new KOSException(string.Format("Attempted to build a MultiModeEngine with {0} engine modules defined instead of 2", moduleEngines.Count));
            }

            MultiMode = true;

            findGimbal();

            EngineInitializeSuffixes();
        }
Пример #2
0
        public EngineValue(global::Part part, IModuleEngine engine, SharedObjects sharedObj)
            : base(part, sharedObj)
        {
            engine1 = engine;

            findGimbal();

            EngineInitializeSuffixes();
        }
Пример #3
0
        public EngineValue(global::Part part, IModuleEngine engine, SharedObjects sharedObj)
            : base(part, sharedObj)
        {
            engine1 = engine;

            findGimbal();

            EngineInitializeSuffixes();
        }
Пример #4
0
        public EngineValue(global::Part part, MultiModeEngine engine, SharedObjects sharedObj)
            : base(part, sharedObj)
        {
            MMengine = engine;

            var moduleEngines = part.Modules.GetModules <ModuleEngines>();

            if (moduleEngines.Count == 2)
            {
                var modEngine1 = moduleEngines.Where(e => e.engineID == MMengine.primaryEngineID).FirstOrDefault();
                if (modEngine1 != null)
                {
                    engine1 = new ModuleEngineAdapter(modEngine1);
                }
                else
                {
                    throw new KOSException("Attempted to build a MultiModeEngine with no engine matching Primary ID");
                }
                var modEngine2 = moduleEngines.Where(e => e.engineID == MMengine.secondaryEngineID).FirstOrDefault();
                if (modEngine2 != null)
                {
                    engine2 = new ModuleEngineAdapter(modEngine2);
                }
                else
                {
                    throw new KOSException("Attempted to build a MultiModeEngine with no engine matching Secondary ID");
                }
            }
            else
            {
                throw new KOSException(string.Format("Attempted to build a MultiModeEngine with {0} engine modules defined instead of 2", moduleEngines.Count));
            }

            MultiMode = true;

            findGimbal();

            EngineInitializeSuffixes();
        }
Пример #5
0
 public EngineValue(global::Part part, IModuleEngine engine, SharedObjects sharedObj)
     : base(part, sharedObj)
 {
     this.engine = engine;
     EngineInitializeSuffixes();
 }
Пример #6
0
 public EngineValue(global::Part part, IModuleEngine engine, SharedObjects sharedObj)
     : base(part, sharedObj)
 {
     this.engine = engine;
     EngineInitializeSuffixes();
 }