Show / Hide Table of Contents

Interface IMyGridTerminalSystem

Describes terminal system (PB scripting interface)

Namespace: Sandbox.ModAPI.Ingame
Assembly: Sandbox.Common.dll
Syntax
public interface IMyGridTerminalSystem

Methods

CanAccess(IMyTerminalBlock, MyTerminalAccessScope)

Checks if the grid terminal system can still access the given IMyTerminalBlock. A block is no longer accessible if it's destroyed, detached, it's ownership has changed or is otherwise disconnected from this grid terminal system.

Declaration
bool CanAccess(IMyTerminalBlock block, MyTerminalAccessScope scope)
Parameters
Type Name Description
IMyTerminalBlock block

Block to test

MyTerminalAccessScope scope

Type of access test

Returns
Type Description
System.Boolean

CanAccess(IMyCubeGrid, MyTerminalAccessScope)

Checks if the grid terminal system can still access the given IMyCubeGrid. A grid is no longer accessible if it's destroyed, detached, it's ownership has changed or is otherwise disconnected from this grid terminal system.

Declaration
bool CanAccess(IMyCubeGrid grid, MyTerminalAccessScope scope)
Parameters
Type Name Description
IMyCubeGrid grid

Grid to check

MyTerminalAccessScope scope

Type of access check

Returns
Type Description
System.Boolean

False if grid is null, closed or you can't access that grid

GetBlockGroups(List<IMyBlockGroup>, Func<IMyBlockGroup, Boolean>)

Fills the provided list with the block groups reachable by this grid terminal system.

Declaration
void GetBlockGroups(List<IMyBlockGroup> blockGroups, Func<IMyBlockGroup, bool> collect = null)
Parameters
Type Name Description
System.Collections.Generic.List<IMyBlockGroup> blockGroups
System.Func<IMyBlockGroup, System.Boolean> collect

Provide a filter method to determine if a given group should be added or not.

GetBlockGroupWithName(String)

Returns the first block group found with the given name. Will return null if no block group with that name can be found.

Declaration
IMyBlockGroup GetBlockGroupWithName(string name)
Parameters
Type Name Description
System.String name

The block group must contain the given name in their name.

Returns
Type Description
IMyBlockGroup

First found block group with name or null if no block group with that name can be found

GetBlocks(List<IMyTerminalBlock>)

Fills the provided list with all the blocks reachable by this grid terminal system. This means all blocks on the same grid, or connected via rotors, pistons or connectors.

Declaration
void GetBlocks(List<IMyTerminalBlock> blocks)
Parameters
Type Name Description
System.Collections.Generic.List<IMyTerminalBlock> blocks

A preallocated list to receive the blocks.

GetBlocksOfType<T>(List<T>, Func<T, Boolean>)

Fills the provided list with the blocks reachable by this grid terminal system. This means all blocks on the same grid, or connected via rotors, pistons or connectors.

Declaration
void GetBlocksOfType<T>(List<T> blocks, Func<T, bool> collect = null)
    where T : class
Parameters
Type Name Description
System.Collections.Generic.List<T> blocks

A preallocated list to receive the blocks.

System.Func<T, System.Boolean> collect

Provide a filter method to determine if a given group should be added or not.

Type Parameters
Name Description
T

The type of blocks to retrieve.

GetBlocksOfType<T>(List<IMyTerminalBlock>, Func<IMyTerminalBlock, Boolean>)

Fills the provided list with the blocks reachable by this grid terminal system. This means all blocks on the same grid, or connected via rotors, pistons or connectors.

Declaration
void GetBlocksOfType<T>(List<IMyTerminalBlock> blocks, Func<IMyTerminalBlock, bool> collect = null)
    where T : class
Parameters
Type Name Description
System.Collections.Generic.List<IMyTerminalBlock> blocks

A preallocated list to receive the blocks.

System.Func<IMyTerminalBlock, System.Boolean> collect

Provide a filter method to determine if a given group should be added or not.

Type Parameters
Name Description
T

The type of blocks to retrieve.

GetBlockWithId(Int64)

Attempts to retrieve the block with the given entity ID.

Declaration
IMyTerminalBlock GetBlockWithId(long id)
Parameters
Type Name Description
System.Int64 id

Entity Id

Returns
Type Description
IMyTerminalBlock

Block or null if no block with provided id found

GetBlockWithName(String)

Returns the first block found with the given name.

Declaration
IMyTerminalBlock GetBlockWithName(string name)
Parameters
Type Name Description
System.String name

The block must contain the given name in their name.

Returns
Type Description
IMyTerminalBlock

First found block with name or null if no block with that name can be found

SearchBlocksOfName(String, List<IMyTerminalBlock>, Func<IMyTerminalBlock, Boolean>)

Fills the provided list with the blocks reachable by this grid terminal system. This means all blocks on the same grid, or connected via rotors, pistons or connectors.

Declaration
void SearchBlocksOfName(string name, List<IMyTerminalBlock> blocks, Func<IMyTerminalBlock, bool> collect = null)
Parameters
Type Name Description
System.String name

The blocks must contain the given name in their name.

System.Collections.Generic.List<IMyTerminalBlock> blocks

A preallocated list to receive the blocks.

System.Func<IMyTerminalBlock, System.Boolean> collect

Provide a filter method to determine if a given group should be added or not.

☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾