public int this[LandingGearMode mode]
 {
     get
     {
         return m_gearStates[(int)mode].Count;
     }
 }
示例#2
0
 public int this[LandingGearMode mode]
 {
     get
     {
         return(m_gearStates[(int)mode].Count);
     }
 }
        void StateChanged(IMyLandingGear gear, LandingGearMode oldMode)
        {
            if (oldMode == LandingGearMode.ReadyToLock && gear.LockMode == LandingGearMode.Locked)
                HudMessage = MySpaceTexts.NotificationLandingGearSwitchLocked;
            else if (oldMode == LandingGearMode.Locked && gear.LockMode == LandingGearMode.Unlocked)
                HudMessage = MySpaceTexts.NotificationLandingGearSwitchUnlocked;
            else //if (oldMode == LandingGearMode.ReadyToLock && gear.LockMode == LandingGearMode.Unlocked)
                HudMessage = MyStringId.NullOrEmpty;

            m_gearStates[(int)oldMode].Remove(gear);
            m_gearStates[(int)gear.LockMode].Add(gear);
        }
示例#4
0
        void StateChanged(IMyLandingGear gear, LandingGearMode oldMode)
        {
            if (oldMode == LandingGearMode.ReadyToLock && gear.LockMode == LandingGearMode.Locked)
            {
                HudMessage = MySpaceTexts.NotificationLandingGearSwitchLocked;
            }
            else if (oldMode == LandingGearMode.Locked && gear.LockMode == LandingGearMode.Unlocked)
            {
                HudMessage = MySpaceTexts.NotificationLandingGearSwitchUnlocked;
            }
            else //if (oldMode == LandingGearMode.ReadyToLock && gear.LockMode == LandingGearMode.Unlocked)
            {
                HudMessage = MyStringId.NullOrEmpty;
            }

            m_gearStates[(int)oldMode].Remove(gear);
            m_gearStates[(int)gear.LockMode].Add(gear);
        }
        public void Main(string argument, UpdateType updateSource)
        {
            //gonna doodle around and figure out how to use classes in C#, and interact with objectins in SE(Space Engineers)
            List <IMyLandingGear> gearsOfLanding = new List <IMyLandingGear>();

            GridTerminalSystem.GetBlocksOfType <IMyLandingGear>(gearsOfLanding);
            foreach (var block in gearsOfLanding)
            {
                block.ToggleLock();
                LandingGearMode asdf  = block.LockMode;
                bool            billy = block.AutoLock;
                Echo($"ASDF'{billy}'!");
                if (billy)
                {
                    block.AutoLock = !billy;
                }
                //ITerminalProperty asdf = block.GetProperty("LockMode");
            }

            //messing around with text panels to actuall /helloworld/
            //put "OwO" tag on a LCD panel
            List <IMyTextPanel> textPanels = new List <IMyTextPanel>();

            //IMyTextPanel helloTextPanel = (IMyTextPanel)GridTerminalSystem.GetBlockWithName("LCD Panel OwO");//getblockwithname doesn't match substrings
            //instead of getblockwithname, getblocksoftype, then find blocks of name?
            GridTerminalSystem.GetBlocksOfType <IMyTextPanel>(textPanels);
            IMyTextPanel helloTextPanel;// = new IMyTextPanel();

            if (textPanels.Count > 0)
            {
                helloTextPanel = textPanels[0];
                helloTextPanel.ShowPublicTextOnScreen();
                Echo($"{helloTextPanel.ShowOnScreen}");
                helloTextPanel.WritePublicText("hello world\nthat was a lot of stuff for some text", false);
            }
            else
            {
                Echo("Text panel block not found");
            }
            //IMyTerminalBlock NANI = GridTerminalSystem.GetBlockWithName("OwO");
            //helloTextPanel = (IMyTextPanel)NANI;
        }
 void StateChanged(IMyLandingGear gear, LandingGearMode oldMode)
 {
     m_gearStates[(int)oldMode].Remove(gear);
     m_gearStates[(int)gear.LockMode].Add(gear);
 }
示例#7
0
 void StateChanged(IMyLandingGear gear, LandingGearMode oldMode)
 {
     m_gearStates[(int)oldMode].Remove(gear);
     m_gearStates[(int)gear.LockMode].Add(gear);
 }