CodeSubWars 0.4.7b
CodeSubWars::CSWFireCommand Class Reference

#include <CSWVariousCommands.h>

Inheritance diagram for CodeSubWars::CSWFireCommand:

Public Member Functions

virtual ARSTD::Command::PtrType copy () const
 
- Public Member Functions inherited from CodeSubWars::CSWExecuteCommand
virtual std::string getName () const
 
- Public Member Functions inherited from ARSTD::Command
virtual PtrType copy () const =0
 
virtual std::string getName () const =0
 
virtual bool wasExecuted () const
 
virtual double getProgress () const
 

Static Public Member Functions

static PtrType create (std::shared_ptr< CSWWeaponBattery > &pWeaponBattery, double fArmDelay=5.0, std::shared_ptr< CSWWeapon > &pWeapon=std::shared_ptr< CSWWeapon >())
 

Detailed Description

This is a specialization of a command. It provides the functionality to launch a Weapon from a WeaponBattery.

Member Function Documentation

◆ copy()

ARSTD::Command::PtrType CodeSubWars::CSWFireCommand::copy ( ) const
virtual

Returns a copy of the command.

Returns
The copied command.

Implements ARSTD::Command.

◆ create()

CSWFireCommand::PtrType CodeSubWars::CSWFireCommand::create ( std::shared_ptr< CSWWeaponBattery > &  pWeaponBattery,
double  fArmDelay = 5.0,
std::shared_ptr< CSWWeapon > &  pWeapon = std::shared_ptr<CSWWeapon>() 
)
static

Creates a new fire command. If no Weapon is loaded to the WeaponBattery nothing will be done.

Parameters
pWeaponBatteryThe WeaponBattery from where the Weapon should be launched.
fArmDelayThe time in seconds when the weapon should be armed.
pWeaponThe Weapon that will be launched. If the given Weapon is not found nothing will be done. If None is given the next available Weapon will be launched. (by default None)
Returns
Returns the new constructed command.

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