Ejemplo n.º 1
0
			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()");
			}
Ejemplo n.º 2
0
		internal static void AddRemoveConnection(AttachmentKind kind, Ingame.IMyCubeGrid grid1, Ingame.IMyCubeGrid grid2, bool add)
		{ AddRemoveConnection(kind, grid1 as IMyCubeGrid, grid2 as IMyCubeGrid, add); }
Ejemplo n.º 3
0
 public PanelInstructions(Ingame.IMyTextPanel block)
 {
     Block = block;
     PublicText = Block.GetPublicText();
 }
Ejemplo n.º 4
0
		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;
		}
Ejemplo n.º 5
0
 public CR_BeaconBlock(Ingame.IMyBeacon beacon)
 {
     this.m_beacon = beacon;
 }
Ejemplo n.º 6
0
 public static MyCubeBlockDefinition GetCubeBlockDefinition(Ingame.IMyCubeBlock block)
 {
     return GetCubeBlockDefinition(block as IMyCubeBlock);
 }
Ejemplo n.º 7
-1
            public CR_AntennaBlock(Ingame.IMyRadioAntenna antenna)
            {
                this.m_antenna = antenna;

                if (s_prop_broadcasting == null)
                    s_prop_broadcasting = antenna.GetProperty("EnableBroadCast").AsBool();
            }