The kOSVesselModule class contains references to anything that is vessel specific rather than processor part specific. For instance, flight controls and steering. It gives a single location to manage instances where docking, staging, and similar events should be handled automatically.
상속: VesselModule
예제 #1
0
        private void ProcessorModeChanged()
        {
            switch (ProcessorMode)
            {
            case ProcessorModes.READY:
                if (SafeHouse.Config.StartOnArchive)
                {
                    shared.VolumeMgr.SwitchTo(Archive);
                }
                else
                {
                    shared.VolumeMgr.SwitchTo(HardDisk);
                }
                firstUpdate = true;     // handle booting the cpu on the next FixedUpdate
                if (shared.Interpreter != null)
                {
                    shared.Interpreter.SetInputLock(false);
                }
                if (shared.Window != null)
                {
                    shared.Window.IsPowered = true;
                }
                foreach (var w in shared.ManagedWindows)
                {
                    w.IsPowered = true;
                }
                break;

            case ProcessorModes.OFF:
            case ProcessorModes.STARVED:
                if (shared.Cpu != null)
                {
                    shared.Cpu.BreakExecution(true);
                }
                if (shared.Interpreter != null)
                {
                    shared.Interpreter.SetInputLock(true);
                }
                if (shared.Window != null)
                {
                    shared.Window.IsPowered = false;
                }
                if (shared.SoundMaker != null)
                {
                    shared.SoundMaker.StopAllVoices();
                }
                foreach (var w in shared.ManagedWindows)
                {
                    w.IsPowered = false;
                }
                kOSVesselModule vesselModule = kOSVesselModule.GetInstance(shared.Vessel);
                if (!vesselModule.AnyProcessorReady())
                {
                    vesselModule.OnAllProcessorsStarved();
                }
                break;
            }
        }
예제 #2
0
 public void TurnOffSasMessage(kOSVesselModule requestor)
 {
     vesselsAskingForSasMsg.Remove(requestor);
 }
예제 #3
0
 public void TurnOnSasMessage(kOSVesselModule requestor)
 {
     vesselsAskingForSasMsg.Add(requestor);
 }