public BindablePoint3DIModel(VRageMath.Vector3I vector) : this() { X = vector.X; Y = vector.Y; Z = vector.Z; }
/// <summary> /// Searches for two other blocks that are perpendicular to the given one. /// If /// </summary> /// <param name="block">The given block</param> /// <returns></returns> public static List <IMyCubeBlock> FindPerpendicularTo(IMyTerminalBlock block) { if (block == null) { throw new Exception("The block is null."); } IMyCubeGrid grid = block.CubeGrid; int maxIndex = Math.Max(grid.Min.AbsMax(), grid.Max.AbsMax()); List <IMyCubeBlock> perpBlocks = new List <IMyCubeBlock>(); perpBlocks.Add(block); int firstIndex = -1; // do a kind of first breath search for (int i = 1; perpBlocks.Count < 3 && i < maxIndex; ++i) { for (int j = 0; j < directions.Count; ++j) { if (j == firstIndex) { continue; } VRageMath.Vector3I v = new VRageMath.Vector3I(directions[j]); IMySlimBlock slim = grid.GetCubeBlock(block.Position + i * v); if (slim != null && slim.FatBlock != null) { perpBlocks.Add(slim.FatBlock); if (perpBlocks.Count == 3) { break; } firstIndex = j; } } } return(perpBlocks); }
void Main() { List <IMyTerminalBlock> blocks = GridTerminalSystem.Blocks; List <IMyBlockGroup> blockGroups = GridTerminalSystem.BlockGroups; GridTerminalSystem.GetBlocksOfType <IMyCubeBlock>(blocks, FuncTest); GridTerminalSystem.SearchBlocksOfName(blockName, blocks, FuncTest); var block = GridTerminalSystem.GetBlockWithName(blockName); IMyCubeBlock cubeBlock = block; bool IsBeingHacked = cubeBlock.IsBeingHacked; bool IsFunctional = cubeBlock.IsFunctional; bool IsWorking = cubeBlock.IsWorking; VRageMath.Vector3I Position = cubeBlock.Position; IMyTerminalBlock terminalBlock = block; string CustomName = terminalBlock.CustomName; string CustomNameWithFaction = terminalBlock.CustomNameWithFaction; string DetailedInfo = terminalBlock.DetailedInfo; bool HasLocalPlayerAccess = terminalBlock.HasLocalPlayerAccess(); bool HasPlayerAccess = terminalBlock.HasPlayerAccess(playerId); //terminalBlock.RequestShowOnHUD(enable); terminalBlock.SetCustomName(CustomName); //terminalBlock.SetCustomName(stringBuilder); bool ShowOnHUD = terminalBlock.ShowOnHUD; List <ITerminalAction> resultList = new List <ITerminalAction>(); terminalBlock.GetActions(resultList, FuncTest); //terminalBlock.SearchActionsOfName(actionName, resultList, FuncTest); //ITerminalAction terminalAction = terminalBlock.GetActionWithName(actionName); //string Id = terminalAction.Id; //StringBuilder Name = terminalAction.Name; //terminalAction.Apply(cubeBlock); IMyFunctionalBlock functionalBlock = block as IMyFunctionalBlock; bool Enabled = functionalBlock.Enabled; }
void IMyVoxelMap.ClampVoxelCoord(ref VRageMath.Vector3I voxelCoord) { Storage.ClampVoxelCoord(ref voxelCoord); }
void IMySlimBlock.InitOrientation(ref VRageMath.Vector3I forward, ref VRageMath.Vector3I up) { InitOrientation(ref forward, ref up); }
public bool ExistsInCell(ref VRageMath.Vector3I cellId) { return(true); }