Show / Hide Table of Contents

Interface IMyTerminalBlock

Describes terminal block (PB scripting interface)

Inherited Members
IMyCubeBlock.GetOwnerFactionTag()
IMyCubeBlock.GetPlayerRelationToOwner()
IMyCubeBlock.GetUserRelationToOwner(Int64, MyRelationsBetweenPlayerAndBlock)
IMyCubeBlock.UpdateIsWorking()
IMyCubeBlock.UpdateVisual()
IMyCubeBlock.BlockDefinition
IMyCubeBlock.CubeGrid
IMyCubeBlock.DefinitionDisplayNameText
IMyCubeBlock.DisassembleRatio
IMyCubeBlock.DisplayNameText
IMyCubeBlock.IsBeingHacked
IMyCubeBlock.IsFunctional
IMyCubeBlock.IsWorking
IMyCubeBlock.Max
IMyCubeBlock.Mass
IMyCubeBlock.Min
IMyCubeBlock.NumberInGrid
IMyCubeBlock.Orientation
IMyCubeBlock.OwnerId
IMyCubeBlock.Position
IMyEntity.GetInventory()
IMyEntity.GetInventory(Int32)
IMyEntity.GetPosition()
IMyEntity.Components
IMyEntity.EntityId
IMyEntity.Name
IMyEntity.DisplayName
IMyEntity.HasInventory
IMyEntity.InventoryCount
IMyEntity.Closed
IMyEntity.WorldAABB
IMyEntity.WorldAABBHr
IMyEntity.WorldMatrix
IMyEntity.WorldVolume
IMyEntity.WorldVolumeHr
Namespace: Sandbox.ModAPI.Ingame
Assembly: Sandbox.Common.dll
Syntax
public interface IMyTerminalBlock : IMyCubeBlock, IMyEntity

Properties

CustomData

Gets or sets the Custom Data string. NOTE: Only use this for user input. For storing large mod configs, create your own MyModStorageComponent

Declaration
string CustomData { get; set; }
Property Value
Type Description
System.String

CustomInfo

Gets information about block status (available from mods) AppendingCustomInfo RefreshCustomInfo().

Declaration
string CustomInfo { get; }
Property Value
Type Description
System.String

CustomName

Gets or sets how block is named in Terminal menu

Declaration
string CustomName { get; set; }
Property Value
Type Description
System.String

CustomNameWithFaction

Gets or sets how block is named in Terminal menu. Work only for Cockpit, LaserAntenna RadioAntenna, SpaceBall, Beacon

Declaration
string CustomNameWithFaction { get; }
Property Value
Type Description
System.String

DetailedInfo

Gets information about block status. In Control panel bottom right text

Declaration
string DetailedInfo { get; }
Property Value
Type Description
System.String

ShowInInventory

Represent terminal gui toggle Show block in Inventory Screen. Gets or sets its value

Declaration
bool ShowInInventory { get; set; }
Property Value
Type Description
System.Boolean

ShowInTerminal

Represent terminal gui toggle Show block in terminal. Gets or sets its value

Declaration
bool ShowInTerminal { get; set; }
Property Value
Type Description
System.Boolean

ShowInToolbarConfig

Represent terminal gui toggle Show in toolbar config. Gets or sets its value

Declaration
bool ShowInToolbarConfig { get; set; }
Property Value
Type Description
System.Boolean

ShowOnHUD

Represent terminal gui toggle Show On HUD. Gets or sets its value

Declaration
bool ShowOnHUD { get; set; }
Property Value
Type Description
System.Boolean

Methods

GetActions(List<ITerminalAction>, Func<ITerminalAction, Boolean>)

Get all terminal actions available for block

Declaration
void GetActions(List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null)
Parameters
Type Name Description
System.Collections.Generic.List<ITerminalAction> resultList

Buffer list, results would be added here. Can be null if always returns false

System.Func<ITerminalAction, System.Boolean> collect

Filter function, if function is null or returns true, terminal action would be added to

See Also
ITerminalAction

GetActionWithName(String)

Get first found terminal action with name

Declaration
ITerminalAction GetActionWithName(string name)
Parameters
Type Name Description
System.String name

Searches for terminal action with this name

Returns
Type Description
ITerminalAction

Found terminal action or null

See Also
ITerminalAction

GetProperties(List<ITerminalProperty>, Func<ITerminalProperty, Boolean>)

Get all terminal actions available for block.

Declaration
void GetProperties(List<ITerminalProperty> resultList, Func<ITerminalProperty, bool> collect = null)
Parameters
Type Name Description
System.Collections.Generic.List<ITerminalProperty> resultList

Buffer list, results would be added here. Can be null if always returns false

System.Func<ITerminalProperty, System.Boolean> collect

Filter function, if function is null or returns true, terminal property would be added to

See Also
ITerminalAction

GetProperty(String)

Finds terminal property with provided id

Declaration
ITerminalProperty GetProperty(string id)
Parameters
Type Name Description
System.String id

Terminal id

Returns
Type Description
ITerminalProperty

Found terminal property or null

See Also
ITerminalProperty

HasLocalPlayerAccess()

Returns if local player can use block. Executes HasPlayerAccess(Int64, MyRelationsBetweenPlayerAndBlock) with local player identityId. On Dedicated Server as identityId it is using 0 as playerId

Declaration
bool HasLocalPlayerAccess()
Returns
Type Description
System.Boolean

Can player access this block or not. (Result of HasPlayerAccess(Int64, MyRelationsBetweenPlayerAndBlock) function call)

HasNobodyPlayerAccessToBlock()

Returns if Nobody has access to block.

Declaration
bool HasNobodyPlayerAccessToBlock()
Returns
Type Description
System.Boolean

True when block is has ShareAll or BigOwners of grid is Nobody

See Also
HasPlayerAccessWithNobodyCheck(Int64, Boolean)

HasPlayerAccess(Int64, MyRelationsBetweenPlayerAndBlock)

Returns if local player can use block. It is also checking for admin access.

Declaration
bool HasPlayerAccess(long playerId, MyRelationsBetweenPlayerAndBlock defaultNoUser)
Parameters
Type Name Description
System.Int64 playerId

PlayerId which you want check

MyRelationsBetweenPlayerAndBlock defaultNoUser
Returns
Type Description
System.Boolean

Can player access block or not

See Also
MyRelationsBetweenPlayerAndBlock

HasPlayerAccessWithNobodyCheck(Int64, Boolean)

Returns if player can use block. If playerId is 0 (Nobody), calls HasNobodyPlayerAccessToBlock instead It is also checking for admin access.

Declaration
bool HasPlayerAccessWithNobodyCheck(long playerId, bool isForPB = false)
Parameters
Type Name Description
System.Int64 playerId

PlayerId which you want check

System.Boolean isForPB

Is used for PB block or not (PB block has more restrictions)

Returns
Type Description
System.Boolean

Can player access block or not

See Also
HasNobodyPlayerAccessToBlock()

IsSameConstructAs(IMyTerminalBlock)

Determines whether this block is Mechanical connected to the other. This is any block connected with rotors or pistons or other mechanical devices, but not things like connectors. This will in most cases constitute your complete construct.

Be aware that using merge blocks combines grids into one, so this function will not filter out grids connected that way. Also be aware that detaching the heads of pistons and rotors will cause this connection to change.

Declaration
bool IsSameConstructAs(IMyTerminalBlock other)
Parameters
Type Name Description
IMyTerminalBlock other

Other block

Returns
Type Description
System.Boolean

True if blocks are on same grid, or has Mechanical linking

SearchActionsOfName(String, List<ITerminalAction>, Func<ITerminalAction, Boolean>)

Get all terminal actions available for block. NOTE: First called <param ref="collect" /> and then <param ref="name" /> check

Declaration
void SearchActionsOfName(string name, List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null)
Parameters
Type Name Description
System.String name

Searches for terminal action with this name

System.Collections.Generic.List<ITerminalAction> resultList

Buffer list, results would be added here. Can be null if always returns false

System.Func<ITerminalAction, System.Boolean> collect

Filter function, if function is null or returns true, terminal action would be added to

See Also
ITerminalAction

SetCustomName(String)

Obsolete

Declaration
void SetCustomName(string text)
Parameters
Type Name Description
System.String text

SetCustomName(StringBuilder)

Obsolete

Declaration
void SetCustomName(StringBuilder text)
Parameters
Type Name Description
System.Text.StringBuilder text

Extension Methods

TerminalBlockExtentions.GetId(IMyTerminalBlock)
TerminalBlockExtentions.ApplyAction(IMyTerminalBlock, String)
TerminalBlockExtentions.ApplyAction(IMyTerminalBlock, String, List<TerminalActionParameter>)
TerminalBlockExtentions.HasAction(IMyTerminalBlock, String)
TerminalBlockExtentions.HasInventory(IMyTerminalBlock)
TerminalBlockExtentions.GetInventory(IMyTerminalBlock, Int32)
TerminalBlockExtentions.GetInventoryCount(IMyTerminalBlock)
TerminalBlockExtentions.GetUseConveyorSystem(IMyTerminalBlock)
TerminalBlockExtentions.SetUseConveyorSystem(IMyTerminalBlock, Boolean)
TerminalPropertyExtensions.GetValueFloat(IMyTerminalBlock, String)
TerminalPropertyExtensions.SetValueFloat(IMyTerminalBlock, String, Single)
TerminalPropertyExtensions.GetValueBool(IMyTerminalBlock, String)
TerminalPropertyExtensions.SetValueBool(IMyTerminalBlock, String, Boolean)
TerminalPropertyExtensions.GetValueColor(IMyTerminalBlock, String)
TerminalPropertyExtensions.SetValueColor(IMyTerminalBlock, String, Color)
TerminalPropertyExtensions.GetValue<T>(IMyTerminalBlock, String)
TerminalPropertyExtensions.GetDefaultValue<T>(IMyTerminalBlock, String)
TerminalPropertyExtensions.GetMininum<T>(IMyTerminalBlock, String)
TerminalPropertyExtensions.GetMinimum<T>(IMyTerminalBlock, String)
TerminalPropertyExtensions.GetMaximum<T>(IMyTerminalBlock, String)
TerminalPropertyExtensions.SetValue<T>(IMyTerminalBlock, String, T)
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾