public VoxelData(Ingame.IMyOreDetector oreDetector, IMyVoxelBase voxel, float maxRange) { this.m_logger = new Logger(GetType().Name, () => oreDetector.CubeGrid.DisplayName, () => oreDetector.DisplayNameText, () => voxel.ToString()); this.m_oreDetector = oreDetector; this.m_voxel = voxel; this.m_storage.Resize(new Vector3I(QUERY_STEP, QUERY_STEP, QUERY_STEP)); this.m_maxRange = maxRange; m_logger.debugLog("Created for voxel at " + voxel.PositionLeftBottomCorner, "VoxelData()"); }
internal static void AddRemoveConnection(AttachmentKind kind, Ingame.IMyCubeGrid grid1, Ingame.IMyCubeGrid grid2, bool add) { AddRemoveConnection(kind, grid1 as IMyCubeGrid, grid2 as IMyCubeGrid, add); }
public PanelInstructions(Ingame.IMyTextPanel block) { Block = block; PublicText = Block.GetPublicText(); }
private bool GetTextPanel(string name, out Ingame.IMyTextPanel panel) { IMyCubeBlock foundBlock = null; int bestNameLength = int.MaxValue; AttachedGrid.RunOnAttachedBlock(Grid, AttachedGrid.AttachmentKind.Permanent, block => { IMyCubeBlock Fatblock = block.FatBlock; if (Fatblock != null && Block.canControlBlock(Fatblock)) { string blockName = Fatblock.DisplayNameText.LowerRemoveWhitespace(); if (blockName.Length < bestNameLength && blockName.Contains(name)) { foundBlock = Fatblock; bestNameLength = blockName.Length; if (name.Length == bestNameLength) return true; } } return false; }, true); panel = foundBlock as Ingame.IMyTextPanel; return panel != null; }
public CR_BeaconBlock(Ingame.IMyBeacon beacon) { this.m_beacon = beacon; }
public static MyCubeBlockDefinition GetCubeBlockDefinition(Ingame.IMyCubeBlock block) { return GetCubeBlockDefinition(block as IMyCubeBlock); }
public CR_AntennaBlock(Ingame.IMyRadioAntenna antenna) { this.m_antenna = antenna; if (s_prop_broadcasting == null) s_prop_broadcasting = antenna.GetProperty("EnableBroadCast").AsBool(); }