Beispiel #1
0
        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];
        }
Beispiel #2
0
        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);
        }
Beispiel #3
0
        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;
        }
Beispiel #4
0
        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;
        }
Beispiel #5
0
        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);
        }
Beispiel #6
0
        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();
        }
Beispiel #7
0
        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);
        }
Beispiel #8
0
        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;
        }
Beispiel #10
0
        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;
        }