Esempio n. 1
0
        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;
        }