|
|
(4 intermediate revisions by the same user not shown) |
Line 1: |
Line 1: |
− | =Sandbox.ModAPI.Ingame.IMyAssembler=
| + | #REDIRECT [[API:Sandbox.ModAPI.Ingame.IMyAssembler]] |
− | This interface is used to work with [[Assembler]] blocks.
| |
− | ==Namespace==
| |
− | [[Sandbox.ModAPI.Ingame]] | |
− | ==Assembly==
| |
− | [[Sandbox.Common]] (Sandbox.Common.dll)
| |
− | ==Syntax==
| |
− | <syntaxhighlight lang="csharp">
| |
− | public interface IMyAssembler : IMyProductionBlock, IMyFunctionalBlock, IMyTerminalBlock, IMyCubeBlock, IMyEntity
| |
− | </syntaxhighlight>
| |
− | ==Methods==
| |
− | ===GetActions===
| |
− | <syntaxhighlight lang="csharp">
| |
− | void GetActions(List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null)
| |
− | </syntaxhighlight>
| |
− | This returns an ITerminalAction list containing a list of all valid actions for the block.
| |
− | | |
− | ===GetActionWithName===
| |
− | <syntaxhighlight lang="csharp">
| |
− | ITerminalAction GetActionWithName(string name)
| |
− | </syntaxhighlight>
| |
− | This searches the block for an associated action corresponding to the specified name.
| |
− | | |
− | ===GetOwnerFactionTag===
| |
− | <syntaxhighlight lang="csharp">
| |
− | string GetOwnerFactionTag()
| |
− | </syntaxhighlight>
| |
− | This returns a string with the faction tag of the associated owner.
| |
− | | |
− | ===GetPlayerRelationToOwner===
| |
− | <syntaxhighlight lang="csharp">
| |
− | MyRelationsBetweenPlayerAndBlock GetUserRelationToOwner(long playerId)
| |
− | </syntaxhighlight>
| |
− | | |
− | ===GetUserRelationToOwner===
| |
− | <syntaxhighlight lang="csharp">
| |
− | MyRelationsBetweenPlayerAndBlock GetUserRelationToOWner(long playerId)
| |
− | </syntaxhighlight>
| |
− | | |
− | ===HasLocalPlayerAccess===
| |
− | <syntaxhighlight lang="csharp">
| |
− | bool HasLocalPlayerAccess()
| |
− | </syntaxhighlight>
| |
− | | |
− | ===HasPlayerAccess===
| |
− | <syntaxhighlight lang="csharp">
| |
− | bool HasPlayerAccess(long playerId)
| |
− | </syntaxhighlight>
| |
− | | |
− | ===MoveQueueItemRequest===
| |
− | <syntaxhighlight lang="csharp">
| |
− | void MoveQueueItemRequest(uint queueItemId, int targetIdx)
| |
− | </syntaxhighlight>
| |
− | | |
− | ===RemoveQueueItemRequest===
| |
− | <syntaxhighlight lang="csharp">
| |
− | void RemoveQueueItemRequest(int itemIdx)
| |
− | </syntaxhighlight>
| |
− | | |
− | ===RequestEnable===
| |
− | <syntaxhighlight lang="csharp">
| |
− | void RequestEnable(bool enable)
| |
− | </syntaxhighlight>
| |
− | Turns the block off or on depending on if true or false. Same as action OnOff_On or OnOff_Off.
| |
− | | |
− | ===RequestShowOnHUD===
| |
− | <syntaxhighlight lang="csharp">
| |
− | void RequestShowOnHUD(bool enable)
| |
− | </syntaxhighlight>
| |
− | Enables or disables the ShowOnHUD option. If an antenna is present, the block will transmit its name and location to users in range of the antenna.
| |
− | | |
− | ===SearchActionsOfName===
| |
− | <syntaxhighlight lang="csharp">
| |
− | void SearchActionsOfName(string name, List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null)
| |
− | </syntaxhighlight>
| |
− | Search for all actions that start with the specified name. For instance, if you search for OnOff, you will get a list of actions returned including "OnOff_On" and "OnOff_Off"
| |
− | | |
− | ===SetCustomName===
| |
− | <syntaxhighlight lang="csharp">
| |
− | void SetCustomName(string text)
| |
− | void SetCustomName(StringBuilder text)
| |
− | </syntaxhighlight>
| |
− | This sets the name of the block. This is the same as changing the block's name in the terminal.
| |
− | | |
− | ===UpdateIsWorking===
| |
− | <syntaxhighlight lang="csharp">
| |
− | void UpdateIsWorking()
| |
− | </syntaxhighlight>
| |
− | Updates the current value of the IsWorking property.
| |
− | | |
− | ===UpdateVisual===
| |
− | <syntaxhighlight lang="csharp">
| |
− | void UpdateVisual()
| |
− | </syntaxhighlight>
| |
− | | |
− | ==Properties==
| |
− | ===BlockDefinition===
| |
− | <syntaxhighlight lang="csharp">
| |
− | SerializableDefinitionId BlockDefinition {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===CheckConnectionAllowed===
| |
− | <syntaxhighlight lang="csharp">
| |
− | bool CheckConnectionAllowed {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===CubeGrid===
| |
− | <syntaxhighlight lang="csharp">
| |
− | IMyCubeGrid CubeGrid {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===CustomName===
| |
− | <syntaxhighlight lang="csharp">
| |
− | string CustomName {get;}
| |
− | </syntaxhighlight>
| |
− | The name of the block as shown in the terminal list.
| |
− | | |
− | ===CustomNameWithFaction===
| |
− | <syntaxhighlight lang="csharp">
| |
− | string CustomNameWithFaction {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===DefinitionDisplayNameText===
| |
− | <syntaxhighlight lang="csharp">
| |
− | string DefinitionDisplayNameText {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===DetailedInfo===
| |
− | <syntaxhighlight lang="csharp">
| |
− | string DetailedInfo {get;}
| |
− | </syntaxhighlight>
| |
− | Output for Assembler:<br>
| |
− | Type: Assembler\nMax Required Input: <float> kW
| |
− | | |
− | With Line Breaks:<br />
| |
− | Type: Assembler<br />
| |
− | Max Required Input: <float> kW><br />
| |
− | | |
− | ===DisassembleRatio===
| |
− | <syntaxhighlight lang="csharp">
| |
− | float DisassembleRatio {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===DisplayNameText===
| |
− | <syntaxhighlight lang="csharp">
| |
− | string DisplayNameText {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===Enabled===
| |
− | <syntaxhighlight lang="csharp">
| |
− | bool Enabled {get;}
| |
− | </syntaxhighlight>
| |
− | On/Off state of the block.
| |
− | | |
− | ===IsBeingHacked===
| |
− | <syntaxhighlight lang="csharp">
| |
− | bool IsBeingHacked {get;}
| |
− | </syntaxhighlight>
| |
− | If the block is being ground down, returns true.
| |
− | | |
− | ===IsFunctional===
| |
− | <syntaxhighlight lang="csharp">
| |
− | bool IsFunctional {get;}
| |
− | </syntaxhighlight>
| |
− | Determines whether or not the block is built enough to perform its function.
| |
− | | |
− | ===IsProducing===
| |
− | <syntaxhighlight lang="csharp">
| |
− | bool IsProducing {get;}
| |
− | </syntaxhighlight>
| |
− | Returns whether the block is actively working on its queue.
| |
− | | |
− | ===IsQueueEmpty===
| |
− | <syntaxhighlight lang="csharp">
| |
− | bool IsQueueEmpty {get;}
| |
− | </syntaxhighlight>
| |
− | Returns whether or not the block's queue is empty.
| |
− | | |
− | ===IsWorking===
| |
− | <syntaxhighlight lang="csharp">
| |
− | bool IsWorking {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===Max===
| |
− | <syntaxhighlight lang="csharp">
| |
− | Vector3I Max {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===Min===
| |
− | <syntaxhighlight lang="csharp">
| |
− | Vector3I Min {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===NextItemId===
| |
− | <syntaxhighlight lang="csharp">
| |
− | uint NextItemId {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===NumberInGrid===
| |
− | <syntaxhighlight lang="csharp">
| |
− | int NumberInGrid {get;}
| |
− | </syntaxhighlight>
| |
− | Returns the number of this block's type in the grid (not quantity of blocks of that type on the grid). For instance, if you have a thruster, and add a second thruster, this will return 2. If you remove the second thruster and build another one to replace it, it will return 3.
| |
− | | |
− | ===Orientation===
| |
− | <syntaxhighlight lang="csharp">
| |
− | MyBlockOrientation Orientation {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===OwnerId===
| |
− | <syntaxhighlight lang="csharp">
| |
− | long OwnerId {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===Position===
| |
− | <syntaxhighlight lang="csharp">
| |
− | Vector3I Position {get;}
| |
− | </syntaxhighlight>
| |
− | | |
− | ===ShowOnHUD===
| |
− | ===UseConveyorSystem===
| |
− | [[Cateogry:Sandbox.ModAPI.Ingame]]
| |