private static void DirectionSetter(IMyTerminalBlock cockpit, long value) { CockpitTerminal cockpitTerm; if (!Registrar.TryGetValue(cockpit, out cockpitTerm)) { Logger.AlwaysLog("Failed lookup of block: " + cockpit.getBestName(), Logger.severity.WARNING); return; } cockpitTerm.m_aeroShowDirection = Base6Directions.EnumDirections[value]; }
private static bool Get_Helper(IMyTerminalBlock block) { CockpitTerminal cockpitTerminal; if (!Registrar.TryGetValue(block, out cockpitTerminal)) { Logger.AlwaysLog("Failed lookup of block: " + block.getBestName(), Logger.severity.WARNING); return(false); } return(cockpitTerminal.m_controlHelper != null); }
public static void SetAutopilotCommands(IMyTerminalBlock block, StringBuilder value) { AutopilotTerminal autopilot; if (!Registrar.TryGetValue(block, out autopilot)) { Logger.AlwaysLog("Failed lookup of block: " + block.getBestName(), Logger.severity.WARNING); return; } autopilot.AutopilotCommandsText = value; }
private static void ToggleAutopilotControl(IMyTerminalBlock block) { AutopilotTerminal autopilot; if (!Registrar.TryGetValue(block, out autopilot)) { Logger.AlwaysLog("Failed lookup of block: " + block.getBestName(), Logger.severity.WARNING); return; } autopilot.AutopilotControlSwitch = !autopilot.AutopilotControlSwitch; }
private static float GetAngularDistance(IMyTerminalBlock block) { AutopilotTerminal autopilot; if (!Registrar.TryGetValue(block, out autopilot)) { Logger.AlwaysLog("Failed lookup of block: " + block.getBestName(), Logger.severity.WARNING); return(0f); } return(autopilot.AngularDistance); }
private static void Set_AeroTerminal(IMyTerminalBlock block, bool value) { CockpitTerminal cockpitTerminal; if (!Registrar.TryGetValue(block, out cockpitTerminal)) { Logger.AlwaysLog("Failed lookup of block: " + block.getBestName(), Logger.severity.WARNING); return; } cockpitTerminal.m_aeroShow = value; block.RebuildControls(); }
private static long DirectionGetter(IMyTerminalBlock cockpit) { CockpitTerminal cockpitTerm; if (!Registrar.TryGetValue(cockpit, out cockpitTerm)) { Logger.AlwaysLog("Failed lookup of block: " + cockpit.getBestName(), Logger.severity.WARNING); return(0L); } for (int index = 0; index < Base6Directions.EnumDirections.Length; index++) { if (Base6Directions.EnumDirections[index] == cockpitTerm.m_aeroShowDirection) { return(index); } } Logger.AlwaysLog("Direction out of bounds: " + cockpitTerm.m_aeroShowDirection, Logger.severity.WARNING); return(0L); }
private static void Set_Helper(IMyTerminalBlock block, bool value) { CockpitTerminal cockpitTerminal; if (!Registrar.TryGetValue(block, out cockpitTerminal)) { Logger.AlwaysLog("Failed lookup of block: " + block.getBestName(), Logger.severity.WARNING); return; } if (value) { cockpitTerminal.m_controlHelper = new FlightControlAssist(cockpitTerminal.m_cockpit); block.RebuildControls(); } else { cockpitTerminal.m_controlHelper.Disable(); cockpitTerminal.m_controlHelper = null; } }
private static void SetAutopilotControl(IMyTerminalBlock block, bool value) { AutopilotTerminal autopilot; if (!Registrar.TryGetValue(block, out autopilot)) { Static.s_logger.alwaysLog("Failed lookup of block: " + block.getBestName(), Logger.severity.WARNING); return; } autopilot.m_autopilotControl.Value = value; }
private static StringBuilder GetAutopilotCommands(IMyTerminalBlock block) { AutopilotTerminal autopilot; if (!Registrar.TryGetValue(block, out autopilot)) { Static.s_logger.alwaysLog("Failed lookup of block: " + block.getBestName(), Logger.severity.WARNING); return new StringBuilder(); ; } return autopilot.m_autopilotCommands.Value; }