CodeSubWars 0.4.7b
CodeSubWars::CSWCommands Class Reference

#include <CSWCommands.h>

Static Public Member Functions

static ARSTD::Command::PtrType setMainEngineIntensity (CSWSubmarine *pSubmarine, double fIntensity)
 
static ARSTD::Command::PtrType setMainEngineDirection (CSWSubmarine *pSubmarine, const double &fHAngle, const double &fVAngle)
 
static ARSTD::Command::PtrType setMainEngineDirection (CSWSubmarine *pSubmarine, const Vector3D &vecDirection)
 
static ARSTD::Command::PtrType disableMainEngine (CSWSubmarine *pSubmarine)
 
static ARSTD::Command::PtrType setBuoyancyTank (CSWSubmarine *pSubmarine, double fIntensity)
 
static ARSTD::Command::PtrType disableBuoyancyTank (CSWSubmarine *pSubmarine)
 
static ARSTD::Command::PtrType setAxialInclinationJetOar (CSWSubmarine *pSubmarine, double fIntensity)
 
static ARSTD::Command::PtrType disableAxialInclinationJetOar (CSWSubmarine *pSubmarine)
 
static ARSTD::Command::PtrType disableAllJetOars (CSWSubmarine *pSubmarine)
 
static ARSTD::Command::PtrType disableAllEngines (CSWSubmarine *pSubmarine)
 
static ARSTD::Command::PtrType stopRotation (CSWSubmarine *pSubmarine)
 
static ARSTD::Command::PtrType setOrientationAbsoluteTowardPosition (CSWSubmarine *pSubmarine, const Vector3D &vecPosition, double fRotationTolerance=0.1, double fEndVelocityTolerance=0.3)
 
static ARSTD::Command::PtrType setOrientationAbsoluteTowardDirection (CSWSubmarine *pSubmarine, const Vector3D &vecDirection, double fRotationTolerance=0.1, double fEndVelocityTolerance=0.3)
 
static ARSTD::Command::PtrType stopMoving (CSWSubmarine *pSubmarine)
 
static ARSTD::Command::PtrType moveForward (CSWSubmarine *pSubmarine, double fDistance, double fEndMoveVelocity=0, double fEndMoveVelocityTolerance=0.1)
 
static ARSTD::Command::PtrType moveUpward (CSWSubmarine *pSubmarine, double fDistance, double fEndMoveVelocity=0, double fEndMoveVelocityTolerance=0.1)
 
static ARSTD::Command::PtrType stopAll (CSWSubmarine *pSubmarine)
 
static ARSTD::Command::PtrType fireSalvo (std::shared_ptr< CSWWeaponBattery > &pWeaponBattery, int nNumTorpedos, double fTimeBetweenLaunches=0)
 

Detailed Description

This class provides useful predefined macro commands.

Member Function Documentation

◆ disableAllEngines()

Command::PtrType CodeSubWars::CSWCommands::disableAllEngines ( CSWSubmarine pSubmarine)
static

Creates a new command that disables all engines.

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
Returns
Returns the new constructed command.

◆ disableAllJetOars()

Command::PtrType CodeSubWars::CSWCommands::disableAllJetOars ( CSWSubmarine pSubmarine)
static

Creates a new command that disables the jet oars which are responsible for rotating a submarine.

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
Returns
Returns the new constructed command.

◆ disableAxialInclinationJetOar()

Command::PtrType CodeSubWars::CSWCommands::disableAxialInclinationJetOar ( CSWSubmarine pSubmarine)
static

Creates a new command that disables the axial inclination jet oar. (sets the intensity to zero)

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
Returns
Returns the new constructed command.

◆ disableBuoyancyTank()

Command::PtrType CodeSubWars::CSWCommands::disableBuoyancyTank ( CSWSubmarine pSubmarine)
static

Creates a new command that disables the buoyancy tank. (sets the intensity to zero)

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
Returns
Returns the new constructed command.

◆ disableMainEngine()

Command::PtrType CodeSubWars::CSWCommands::disableMainEngine ( CSWSubmarine pSubmarine)
static

Creates a new command that disables the main engine. (sets the intensity to zero)

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
Returns
Returns the new constructed command.

◆ fireSalvo()

Command::PtrType CodeSubWars::CSWCommands::fireSalvo ( std::shared_ptr< CSWWeaponBattery > &  pWeaponBattery,
int  nNumTorpedos,
double  fTimeBetweenLaunches = 0 
)
static

Creates a new command that make the submarine launches weapon from the specified WeaponBattery.

Parameters
pWeaponBatteryThe weapon battery from which the weapons should be launched.
nNumTorpedosThe number of torpedoes that should be launched.
fTimeBetweenLaunchesThe time between launches that should be wait in seconds.
Returns
Returns the new constructed command.

◆ moveForward()

Command::PtrType CodeSubWars::CSWCommands::moveForward ( CSWSubmarine pSubmarine,
double  fDistance,
double  fEndMoveVelocity = 0,
double  fEndMoveVelocityTolerance = 0.1 
)
static

Creates a new command that make the submarine moves forward by a given distance.

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
fDistanceThe distance that the submarine should move. (positive means forward, negative means backward)
fEndMoveVelocityThe end translation velocity in meter per second.
fEndMoveVelocityToleranceThe end translation velocity tolerance in degree per second.
Returns
Returns the new constructed command.

◆ moveUpward()

Command::PtrType CodeSubWars::CSWCommands::moveUpward ( CSWSubmarine pSubmarine,
double  fDistance,
double  fEndMoveVelocity = 0,
double  fEndMoveVelocityTolerance = 0.1 
)
static

Creates a new command that make the submarine moves upward by a given distance.

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
fDistanceThe distance that the submarine should move. (positive means upward, negative means downward)
fEndMoveVelocityThe end translation velocity in meter per second.
fEndMoveVelocityToleranceThe end translation velocity tolerance in degree per second.
Returns
Returns the new constructed command.

◆ setAxialInclinationJetOar()

Command::PtrType CodeSubWars::CSWCommands::setAxialInclinationJetOar ( CSWSubmarine pSubmarine,
double  fIntensity 
)
static

Creates a new command that sets the intensity of the axial inclination jet oar.

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
fIntensityThe new intensity.
Returns
Returns the new constructed command.

◆ setBuoyancyTank()

Command::PtrType CodeSubWars::CSWCommands::setBuoyancyTank ( CSWSubmarine pSubmarine,
double  fIntensity 
)
static

Creates a new command that sets the intensity of the buoyancy tank.

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
fIntensityThe new intensity.
Returns
Returns the new constructed command.

◆ setMainEngineDirection() [1/2]

Command::PtrType CodeSubWars::CSWCommands::setMainEngineDirection ( CSWSubmarine pSubmarine,
const double &  fHAngle,
const double &  fVAngle 
)
static

Creates a new command that sets the direction of the main engine.

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
fHAngleThe new horizontal angle. Positiv means rightward (in degree).
fVAngleThe new vertical angle. Positiv means upward (in degree).
Returns
Returns the new constructed command.

◆ setMainEngineDirection() [2/2]

Command::PtrType CodeSubWars::CSWCommands::setMainEngineDirection ( CSWSubmarine pSubmarine,
const Vector3D &  vecDirection 
)
static

Creates a new command that sets the direction of the main engine.

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
vecDirectionThe new direction relative to its parent.
Returns
Returns the new constructed command.

◆ setMainEngineIntensity()

Command::PtrType CodeSubWars::CSWCommands::setMainEngineIntensity ( CSWSubmarine pSubmarine,
double  fIntensity 
)
static

Creates a new command that sets the intensity of the main engine.

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
fIntensityThe new intensity.
Returns
Returns the new constructed command.

◆ setOrientationAbsoluteTowardDirection()

Command::PtrType CodeSubWars::CSWCommands::setOrientationAbsoluteTowardDirection ( CSWSubmarine pSubmarine,
const Vector3D &  vecDirection,
double  fRotationTolerance = 0.1,
double  fEndVelocityTolerance = 0.3 
)
static

Creates a new command that controlls the absolute orientation by controlling the intensities of:

  1. the axial inclination jet oar, 2. the inclination jet oar and finally the axial inclination jet oar so that the submarine is directed to the given absolut direction with nearly zero end velocity about all axis.
    Parameters
    pSubmarineThe submarine where the command should be executed (should always be self).
    vecDirectionThe direction in world coorinates which the subarmine should direct.
    fRotationToleranceThe destination rotation tolerance in degree. Should be larger or equal than 0.1.
    fEndVelocityToleranceThe angular end velocity tolerance in degree per second.
    Returns
    Returns the new constructed command.

◆ setOrientationAbsoluteTowardPosition()

Command::PtrType CodeSubWars::CSWCommands::setOrientationAbsoluteTowardPosition ( CSWSubmarine pSubmarine,
const Vector3D &  vecPosition,
double  fRotationTolerance = 0.1,
double  fEndVelocityTolerance = 0.3 
)
static

Creates a new command that controlls the absolute orientation by controlling the intensities of:

  1. the axial inclination jet oar, 2. the inclination jet oar and finally the axial inclination jet oar so that the submarine is directed to the given absolut position with nearly zero end velocity about all axis.
    Parameters
    pSubmarineThe submarine where the command should be executed (should always be self).
    vecPositionThe position in world coorinates to which the subarmine should direct to.
    fRotationToleranceThe destination rotation tolerance in degree. Should be larger or equal than 0.1.
    fEndVelocityToleranceThe angular end velocity tolerance in degree per second.
    Returns
    Returns the new constructed command.

◆ stopAll()

Command::PtrType CodeSubWars::CSWCommands::stopAll ( CSWSubmarine pSubmarine)
static

Creates a new command that make the submarine does a full stop. The translation velocity and the rotation velocity becomes nearly zero.

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
Returns
Returns the new constructed command.
Postcondition
The translation and angular velocity is near zero.

◆ stopMoving()

Command::PtrType CodeSubWars::CSWCommands::stopMoving ( CSWSubmarine pSubmarine)
static

Creates a new command that controlls the translation by controlling the intensities of: main engine and the buoyancy tank. so that the submarine has nearly no end translation velocity.

Parameters
pSubmarineThe submarine where the command should be executed (should always be self).
Postcondition
The translation velocity is near zero.
Returns
Returns the new constructed command.

◆ stopRotation()

Command::PtrType CodeSubWars::CSWCommands::stopRotation ( CSWSubmarine pSubmarine)
static

Creates a new command that controlls the rotation velocity by controlling the intensities of:

  1. the axial inclination jet oar, 2. the inclination jet oar and finally the axial inclination jet oar so that the rotation velocity of the submarine is nearly zero end velocity about all axis.
    Parameters
    pSubmarineThe submarine where the command should be executed (should always be self).
    Returns
    Returns the new constructed command.
    Postcondition
    The angular velocity is near zero.

Generated at Sun Aug 7 2022 for project CodeSubWars. www.codesubwars.org