Difference between revisions of "Programming Guide/API List"
From Space Engineers Wiki
CheronoLord (talk | contribs) m (→Properties) |
Vox Serico (talk | contribs) m (Added links to Malware's Development Kit for Space Engineers) |
||
Line 3: | Line 3: | ||
This is a list of all API functions currently available<ref>http://steamcommunity.com/sharedfiles/filedetails/?id=360966557</ref>. | This is a list of all API functions currently available<ref>http://steamcommunity.com/sharedfiles/filedetails/?id=360966557</ref>. | ||
+ | |||
+ | For an up-to-date (as of 2020-09-26) API listing and basic tutorials, please visit [https://github.com/malware-dev/MDK-SE/wiki Malware's Development Kit for Space Engineers]. | ||
=== GridTerminalSystem === | === GridTerminalSystem === |
Latest revision as of 18:53, 26 September 2020
API List
This is a list of all API functions currently available[1].
For an up-to-date (as of 2020-09-26) API listing and basic tutorials, please visit Malware's Development Kit for Space Engineers.
GridTerminalSystem
Currently only following “built-in” variable that user can use: GridTerminalSystem. This is entry point of entire grid terminal system.
Properties
Property | Return Type | Description | get | set |
---|---|---|---|---|
Blocks | List<IMyTerminalBlock> | Returns a list of all blocks on the grid | V | X |
BlockGroups | List<IMyBlockGroup> | Returns a list of all groups in the grid. | V | X |
Methods
Method | Return Type | Description |
---|---|---|
GetBlocksOfType<T>(List<IMyTerminalBlock> blocks, Func<IMyTerminalBlock, bool> collect = null) | void | Puts all found blocks of provided type in the list that are connected to the grid |
SearchBlocksOfName(string name,List<IMyTerminalBlock> blocks, Func<IMyTerminalBlock, bool> collect = null) | void | Puts all found blocks of provided name in the list that are connected to the grid |
GetBlockWithName(string name) | IMyTerminalBlock | Returns a block with provided name |
IMyCubeBlock
IMyCubeBlock is base class for every terminal block.
Properties
Property | Return Type | Description | get | set |
---|---|---|---|---|
IsBeingHacked | boolean | Returns true if block is being hacked | V | X |
IsFunctional | boolean | Returns true if current block is operational | V | X |
IsWorking | boolean | Returns true if current block is powered/working | V | X |
Position | VRageMath.Vector3I | Returns current position | V | X |
IMyTerminalBlock
MyTerminalBlock is base class for every terminal block.
Properties
Property | Return Type | Description | get | set |
---|---|---|---|---|
CustomName | String | Returns name of the block | V | X |
CustomNameWithFaction | String | ... | V | X |
DetailedInfo | String | ... | V | X |
ShowOnHUD | boolean | Whether block shows up on hud | V | X |
Methods
Method | Return Type | Description |
---|---|---|
HasLocalPlayerAccess() | boolean | ... |
HasPlayerAccess(long playerId) | boolean | ... |
RequestShowOnHUD(bool enable) | void | ... |
SetCustomName(string text) | void | Set the name of the block |
SetCustomName(StringBuilder text) | void | Set the name of the block |
GetActions(List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null) | void | Populates list with available actions |
SearchActionsOfName(string name,List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null) | void | Populates list with available actions matching the name (Case Insensitive) |
GetActionWithName(string name) | ITerminalAction | Returns action with specified name (Case Sensitive) |
SetValue(string propertyName, object value) | void | Sets the specified property name to the given value |
ITerminalAction
ITerminal action is representation of concrete action that can be triggered.
Properties
Property | Return Type | Description | get | set |
---|---|---|---|---|
Id | String | Returns id of the action | V | X |
Name | StringBuilder | Returns the name of the action | V | X |
Methods
Method | Return Type | Description |
---|---|---|
Apply(IMyCubeBlock block) | void | Apply the action on a block |
IMyFunctionalBlock
IMyFunctionalBlock is base class for every block that can be turned on or off, it’s derived from IMyTerminal block e.g. every Functional block is Terminal block but not all terminal blocks can be turned on or off.
Properties
Property | Return Type | Description | get | set |
---|---|---|---|---|
Enabled | boolean | Returns true if the block is turned on | V | X |