Interface IMyTerminalActionsHelper
API class for interactions with terminal actions and properties
Namespace: Sandbox.ModAPI
Assembly: Sandbox.Common.dll
Syntax
public interface IMyTerminalActionsHelper
Methods
GetActions(Type, List<ITerminalAction>, Func<ITerminalAction, Boolean>)
Gets available ITerminalAction for a block with specified type
Declaration
void GetActions(Type blockType, List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null)
Parameters
Type | Name | Description |
---|---|---|
System.Type | blockType | Block type, that should have actions |
System.Collections.Generic.List<ITerminalAction> | resultList | Preallocated list, where results would be added |
System.Func<ITerminalAction, System.Boolean> | collect | Filter function, if it returns true, item would be added to list |
GetActionWithName(String, Type)
Gets first available ITerminalAction for a block with specified type and name
Declaration
ITerminalAction GetActionWithName(string actionId, Type blockType)
Parameters
Type | Name | Description |
---|---|---|
System.String | actionId | action.Id should be equal to this argument |
System.Type | blockType | Block type, that should have action |
Returns
Type | Description |
---|---|
ITerminalAction | Terminal action or null |
GetProperties(Type, List<ITerminalProperty>, Func<ITerminalProperty, Boolean>)
Gets all properties that belongs to specific block
Declaration
void GetProperties(Type blockType, List<ITerminalProperty> resultList, Func<ITerminalProperty, bool> collect = null)
Parameters
Type | Name | Description |
---|---|---|
System.Type | blockType | Block type, that should have properties |
System.Collections.Generic.List<ITerminalProperty> | resultList | Preallocated list, where results would be added |
System.Func<ITerminalProperty, System.Boolean> | collect | Filter function, if it returns true, item would be added to list |
GetProperty(String, Type)
Gets property by id
Declaration
ITerminalProperty GetProperty(string id, Type blockType)
Parameters
Type | Name | Description |
---|---|---|
System.String | id | Terminal property id should be equal this argument |
System.Type | blockType | Block type, that should have property |
Returns
Type | Description |
---|---|
ITerminalProperty |
GetTerminalSystemForGrid(IMyCubeGrid)
Gets IMyGridTerminalSystem for grid
Declaration
IMyGridTerminalSystem GetTerminalSystemForGrid(IMyCubeGrid grid)
Parameters
Type | Name | Description |
---|---|---|
IMyCubeGrid | grid | For which you want to IMyGridTerminalSystem |
Returns
Type | Description |
---|---|
IMyGridTerminalSystem | IMyGridTerminalSystem or null, if called too early (on MyCubeGrid.InitInternal). |
Remarks
Connected grids with Logical linking has 1 same for all IMyGridTerminalSystem. You can pass any grid belonging to that grid-group.
SearchActionsOfName(String, Type, List<ITerminalAction>, Func<ITerminalAction, Boolean>)
Gets available ITerminalAction for a block with specified type and name
Declaration
void SearchActionsOfName(string name, Type blockType, List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Action should contain or be equal to this argument |
System.Type | blockType | Block type, that should have actions |
System.Collections.Generic.List<ITerminalAction> | resultList | Preallocated list, where results would be added |
System.Func<ITerminalAction, System.Boolean> | collect | Filter function, if it returns true, item would be added to list |