public static void SetCockpitControls(IMyTerminalBlock block, DebugCockpitControls controls = null) { if (CockpitSettings.ContainsKey(block)) { CockpitSettings[block] = controls; } else { CockpitSettings.Add(block, controls); } }
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); }