Difference between revisions of "API:Sandbox.ModAPI.Ingame.IMyCameraBlock"
(Created page with "{{subst:Template:APINamespaceHeaders|Sandbox.ModAPI.Ingame|Sandbox.Common|Sandbox.Common.dll}}") |
(Added description.) |
||
(One intermediate revision by the same user not shown) | |||
Line 3: | Line 3: | ||
--> | --> | ||
− | = | + | =Sandbox.ModAPI.Ingame.IMyCameraBlock= |
− | + | Interface for camera blocks. | |
− | ==Namespace== | + | ==Namespace== |
[[Sandbox.ModAPI.Ingame]] | [[Sandbox.ModAPI.Ingame]] | ||
==Assembly== | ==Assembly== | ||
− | [[Sandbox.Common]] (Sandbox.Common.dll) | + | [[Sandbox.Common]] (Sandbox.Common.dll) |
==Syntax== | ==Syntax== | ||
<syntaxhighlight lang="csharp"> | <syntaxhighlight lang="csharp"> | ||
− | + | public interface IMyCameraBlock : IMyFunctionalBlock, IMyTerminalBlock, IMyCubeBlock, IMyEntity | |
</syntaxhighlight> | </syntaxhighlight> | ||
==Methods== | ==Methods== | ||
+ | ===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. | ||
+ | ===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. | ||
+ | |||
+ | ===HasLocalPlayerAccess=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | bool HasLocalPlayerAccess() | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===HasPlayerAccess=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | bool HasPlayerAccess(long playerId) | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===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. | ||
+ | ===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> | ||
+ | |||
+ | ===UpdateIsWorking=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | void UpdateIsWorking() | ||
+ | </syntaxhighlight> | ||
+ | Updates the current value of the IsWorking property. | ||
+ | |||
+ | ===UpdateVisual=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | void UpdateVisual() | ||
+ | </syntaxhighlight> | ||
==Properties== | ==Properties== | ||
+ | ===Enabled=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | bool Enabled {get;} | ||
+ | </syntaxhighlight> | ||
+ | On/Off state of the block. | ||
+ | ===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> | ||
+ | |||
+ | ===DetailedInfo=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | string DetailedInfo {get;} | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===ShowOnHUD=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | Bool ShowOnHUD {get;} | ||
+ | </syntaxhighlight> | ||
+ | Returns whether or not ShowOnHUD is active. | ||
+ | ===BlockDefinition=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | SerializableDefinitionId BlockDefinition {get;} | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===CheckConnectionAllowed=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | bool CheckConnectionAllowed {get;} | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===CubeGrid=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | IMyCubeGrid CubeGrid {get;} | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===DefinitionDisplayNameText=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | string DefinitionDisplayNameText {get;} | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===DisassembleRatio=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | float DisassembleRatio {get;} | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===DisplayNameText=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | string DisplayNameText {get;} | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===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. | ||
+ | |||
+ | ===IsWorking=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | bool IsWorking {get;} | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===Max=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | Vector3I Max {get;} | ||
+ | </syntaxhighlight> | ||
+ | |||
+ | ===Min=== | ||
+ | <syntaxhighlight lang="csharp"> | ||
+ | Vector3I Min {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> | ||
− | [[Category: API]] | + | [[Category: API]][[Category:Programmable Block]][[Category:Sandbox.ModAPI.Ingame]] |
Latest revision as of 07:19, 13 January 2015
Contents
- 1 Sandbox.ModAPI.Ingame.IMyCameraBlock
- 1.1 Namespace
- 1.2 Assembly
- 1.3 Syntax
- 1.4 Methods
- 1.4.1 RequestEnable
- 1.4.2 GetActions
- 1.4.3 GetActionWithName
- 1.4.4 HasLocalPlayerAccess
- 1.4.5 HasPlayerAccess
- 1.4.6 RequestShowOnHUD
- 1.4.7 SearchActionsOfName
- 1.4.8 SetCustomName
- 1.4.9 GetOwnerFactionTag
- 1.4.10 GetPlayerRelationToOwner
- 1.4.11 GetUserRelationToOwner
- 1.4.12 UpdateIsWorking
- 1.4.13 UpdateVisual
- 1.5 Properties
- 1.5.1 Enabled
- 1.5.2 CustomName
- 1.5.3 CustomNameWithFaction
- 1.5.4 DetailedInfo
- 1.5.5 ShowOnHUD
- 1.5.6 BlockDefinition
- 1.5.7 CheckConnectionAllowed
- 1.5.8 CubeGrid
- 1.5.9 DefinitionDisplayNameText
- 1.5.10 DisassembleRatio
- 1.5.11 DisplayNameText
- 1.5.12 IsBeingHacked
- 1.5.13 IsFunctional
- 1.5.14 IsWorking
- 1.5.15 Max
- 1.5.16 Min
- 1.5.17 NumberInGrid
- 1.5.18 Orientation
- 1.5.19 OwnerId
- 1.5.20 Position
Sandbox.ModAPI.Ingame.IMyCameraBlock
Interface for camera blocks.
Namespace
Assembly
Sandbox.Common (Sandbox.Common.dll)
Syntax
public interface IMyCameraBlock : IMyFunctionalBlock, IMyTerminalBlock, IMyCubeBlock, IMyEntity
Methods
RequestEnable
void RequestEnable(bool enable)
Turns the block off or on depending on if true or false. Same as action OnOff_On or OnOff_Off.
GetActions
void GetActions(List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null)
This returns an ITerminalAction list containing a list of all valid actions for the block.
GetActionWithName
ITerminalAction GetActionWithName(string name)
This searches the block for an associated action corresponding to the specified name.
HasLocalPlayerAccess
bool HasLocalPlayerAccess()
HasPlayerAccess
bool HasPlayerAccess(long playerId)
RequestShowOnHUD
void RequestShowOnHUD(bool enable)
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
void SearchActionsOfName(string name, List<ITerminalAction> resultList, Func<ITerminalAction, bool> collect = null)
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
void SetCustomName(string text)
void SetCustomName(StringBuilder text)
This sets the name of the block. This is the same as changing the block's name in the terminal.
GetOwnerFactionTag
string GetOwnerFactionTag()
This returns a string with the faction tag of the associated owner.
GetPlayerRelationToOwner
MyRelationsBetweenPlayerAndBlock GetUserRelationToOwner(long playerId)
GetUserRelationToOwner
MyRelationsBetweenPlayerAndBlock GetUserRelationToOWner(long playerId)
UpdateIsWorking
void UpdateIsWorking()
Updates the current value of the IsWorking property.
UpdateVisual
void UpdateVisual()
Properties
Enabled
bool Enabled {get;}
On/Off state of the block.
CustomName
string CustomName {get;}
The name of the block as shown in the terminal list.
CustomNameWithFaction
string CustomNameWithFaction {get;}
DetailedInfo
string DetailedInfo {get;}
ShowOnHUD
Bool ShowOnHUD {get;}
Returns whether or not ShowOnHUD is active.
BlockDefinition
SerializableDefinitionId BlockDefinition {get;}
CheckConnectionAllowed
bool CheckConnectionAllowed {get;}
CubeGrid
IMyCubeGrid CubeGrid {get;}
DefinitionDisplayNameText
string DefinitionDisplayNameText {get;}
DisassembleRatio
float DisassembleRatio {get;}
DisplayNameText
string DisplayNameText {get;}
IsBeingHacked
bool IsBeingHacked {get;}
If the block is being ground down, returns true.
IsFunctional
bool IsFunctional {get;}
Determines whether or not the block is built enough to perform its function.
IsWorking
bool IsWorking {get;}
Max
Vector3I Max {get;}
Min
Vector3I Min {get;}
NumberInGrid
int NumberInGrid {get;}
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
MyBlockOrientation Orientation {get;}
OwnerId
long OwnerId {get;}
Position
Vector3I Position {get;}