Пример #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];
        }
Пример #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);
        }
Пример #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;
        }
Пример #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;
        }
Пример #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);
        }
Пример #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();
        }
Пример #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);
        }
Пример #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;
            }
        }
Пример #9
0
        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;
        }
Пример #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;
        }