public void Startup() { this.panelState = base.module.deployState; if (this.panelState == ModuleDeployableSolarPanel.DeployState.EXTENDED) { core.EnableFailure("TestFlightFailure_SolarMechFail"); } else { core.DisableFailure("TestFlightFailure_SolarMechFail"); } }
public override void OnUpdate() { if (this.panelState != base.module.deployState) { this.panelState = base.module.deployState; if (TestFlightEnabled && !base.part.ShieldedFromAirstream && (this.panelState == ModuleDeployableSolarPanel.DeployState.EXTENDED) != this.failureActive) { this.failureActive = !this.failureActive; if (this.failureActive) { core.EnableFailure("TestFlightFailure_SolarMechFail"); } else { core.DisableFailure("TestFlightFailure_SolarMechFail"); } } } }
public static SolarPanelState ToSolarPanelState(this ModuleDeployableSolarPanel.DeployState state) { switch (state) { case ModuleDeployableSolarPanel.DeployState.EXTENDED: return(SolarPanelState.Extended); case ModuleDeployableSolarPanel.DeployState.RETRACTED: return(SolarPanelState.Retracted); case ModuleDeployableSolarPanel.DeployState.EXTENDING: return(SolarPanelState.Extending); case ModuleDeployableSolarPanel.DeployState.RETRACTING: return(SolarPanelState.Retracting); case ModuleDeployableSolarPanel.DeployState.BROKEN: return(SolarPanelState.Broken); default: throw new ArgumentOutOfRangeException("state"); } }