示例#1
0
 public static void SetCockpitControls(IMyTerminalBlock block, DebugCockpitControls controls = null)
 {
     if (CockpitSettings.ContainsKey(block))
     {
         CockpitSettings[block] = controls;
     }
     else
     {
         CockpitSettings.Add(block, controls);
     }
 }
示例#2
0
        public static DebugCockpitControls GetCockpitControls(IMyTerminalBlock block)
        {
            DebugCockpitControls controls = null;

            if (!CockpitSettings.TryGetValue(block, out controls))
            {
                controls = new DebugCockpitControls();
                var grid = block.SlimBlock.CubeGrid as MyCubeGrid;
                controls.CurrentGridVulnerable = grid.DestructibleBlocks;
                controls.CurrentGridEditable   = grid.Editable;
                SetCockpitControls(block, controls);
            }

            return(controls);
        }