Space Engineers
Public Member Functions | Properties | List of all members
Sandbox.Game.Entities.IMyGunObject< out out T > Interface Template Reference

This can be hand held weapon (including welders and drills) as well as weapons on ship (including ship drills). More...

Public Member Functions

Vector3 DirectionToTarget (Vector3D target)
 
bool CanShoot (MyShootActionEnum action, long shooter, out MyGunStatusEnum status)
 Should return true if and only if the gun would be able to shoot using the given shoot action. This method should not do any side-effects such as play sounds or create particle FX. More...
 
void Shoot (MyShootActionEnum action, Vector3 direction, Vector3D?overrideWeaponPos, string gunAction=null)
 Perform the shoot action according to the action parameter. This method should only be called when CanShoot returns true for the given action! More...
 
void EndShoot (MyShootActionEnum action)
 
void BeginFailReaction (MyShootActionEnum action, MyGunStatusEnum status)
 Perform a fail reaction to begin shoot that is shown on all clients (e.g. fail sound, etc.) More...
 
void BeginFailReactionLocal (MyShootActionEnum action, MyGunStatusEnum status)
 
void ShootFailReactionLocal (MyShootActionEnum action, MyGunStatusEnum status)
 
int GetAmmunitionAmount ()
 
void OnControlAcquired (MyCharacter owner)
 
void OnControlReleased ()
 
void DrawHud (IMyCameraController camera, long playerId)
 
void UpdateSoundEmitter ()
 

Properties

float BackkickForcePerSecond [get]
 
float ShakeAmount [get]
 
MyDefinitionId DefinitionId [get]
 
bool EnabledInWorldRules [get]
 
GunBase [get]
 
bool IsShooting [get]
 Should return true when the weapon is shooting projectiles and other classes should react accordingly (i.e.apply backkick force etc.) More...
 
int ShootDirectionUpdateTime [get]
 Zero means that the gun should not update shoot direction at all More...
 

Detailed Description

This can be hand held weapon (including welders and drills) as well as weapons on ship (including ship drills).

Type Constraints
T :MyDeviceBase 

Definition at line 33 of file IMyGunObject.cs.

Member Function Documentation

void Sandbox.Game.Entities.IMyGunObject< out out T >.BeginFailReaction ( MyShootActionEnum  action,
MyGunStatusEnum  status 
)

Perform a fail reaction to begin shoot that is shown on all clients (e.g. fail sound, etc.)

Parameters
actionThe shooting action, whose begin shoot failed
statusWhy the begin shoot failed
void Sandbox.Game.Entities.IMyGunObject< out out T >.BeginFailReactionLocal ( MyShootActionEnum  action,
MyGunStatusEnum  status 
)
bool Sandbox.Game.Entities.IMyGunObject< out out T >.CanShoot ( MyShootActionEnum  action,
long  shooter,
out MyGunStatusEnum  status 
)

Should return true if and only if the gun would be able to shoot using the given shoot action. This method should not do any side-effects such as play sounds or create particle FX.

Parameters
actionThe shooting action to test
statusDetailed status of the gun, telling why the gun couldn't perform the given shoot action
Returns
Vector3 Sandbox.Game.Entities.IMyGunObject< out out T >.DirectionToTarget ( Vector3D  target)
void Sandbox.Game.Entities.IMyGunObject< out out T >.DrawHud ( IMyCameraController  camera,
long  playerId 
)
void Sandbox.Game.Entities.IMyGunObject< out out T >.EndShoot ( MyShootActionEnum  action)
int Sandbox.Game.Entities.IMyGunObject< out out T >.GetAmmunitionAmount ( )
void Sandbox.Game.Entities.IMyGunObject< out out T >.OnControlAcquired ( MyCharacter  owner)
void Sandbox.Game.Entities.IMyGunObject< out out T >.OnControlReleased ( )
void Sandbox.Game.Entities.IMyGunObject< out out T >.Shoot ( MyShootActionEnum  action,
Vector3  direction,
Vector3D overrideWeaponPos,
string  gunAction = null 
)

Perform the shoot action according to the action parameter. This method should only be called when CanShoot returns true for the given action!

Parameters
actionThe shooting action to perform
overrideWeaponPosChanges weapon position, world space.
directionThe prefered direction of shooting
void Sandbox.Game.Entities.IMyGunObject< out out T >.ShootFailReactionLocal ( MyShootActionEnum  action,
MyGunStatusEnum  status 
)
void Sandbox.Game.Entities.IMyGunObject< out out T >.UpdateSoundEmitter ( )

Property Documentation

float Sandbox.Game.Entities.IMyGunObject< out out T >.BackkickForcePerSecond
get

Definition at line 35 of file IMyGunObject.cs.

MyDefinitionId Sandbox.Game.Entities.IMyGunObject< out out T >.DefinitionId
get

Definition at line 37 of file IMyGunObject.cs.

bool Sandbox.Game.Entities.IMyGunObject< out out T >.EnabledInWorldRules
get

Definition at line 38 of file IMyGunObject.cs.

T Sandbox.Game.Entities.IMyGunObject< out out T >.GunBase
get

Definition at line 39 of file IMyGunObject.cs.

bool Sandbox.Game.Entities.IMyGunObject< out out T >.IsShooting
get

Should return true when the weapon is shooting projectiles and other classes should react accordingly (i.e.apply backkick force etc.)

Definition at line 65 of file IMyGunObject.cs.

float Sandbox.Game.Entities.IMyGunObject< out out T >.ShakeAmount
get

Definition at line 36 of file IMyGunObject.cs.

int Sandbox.Game.Entities.IMyGunObject< out out T >.ShootDirectionUpdateTime
get

Zero means that the gun should not update shoot direction at all

Returns
Minimal time interval in milliseconds between two direction updates

Definition at line 71 of file IMyGunObject.cs.


The documentation for this interface was generated from the following file: