CodeSubWars 0.4.7b
ARSTD::MacroCommand Class Reference

#include <MacroCommand.h>

Inheritance diagram for ARSTD::MacroCommand:

Public Member Functions

virtual Command::PtrType copy () const
 
virtual std::string getName () const
 
virtual bool wasExecuted () const
 
virtual double getProgress () const
 
void attach (Command::PtrType pCommand)
 
void detach (Command::PtrType pCommand)
 
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 (const std::string &strName)
 

Detailed Description

This class provides functionality for defining macro commands. Macro commands are a list of other commands. These commands can also be MacroCommands. The order of the list is the same as the execution order.

Member Function Documentation

◆ attach()

void ARSTD::MacroCommand::attach ( Command::PtrType  pCommand)

Attaches a command or MacroCommand.

Parameters
pCommandThe command that should be attached.

◆ copy()

Command::PtrType ARSTD::MacroCommand::copy ( ) const
virtual

Returns a copy of the command.

Returns
The copied command.

Implements ARSTD::Command.

◆ create()

MacroCommand::PtrType ARSTD::MacroCommand::create ( const std::string &  strName)
static

Creates a new MacroCommand.

Parameters
strNameThe name of the MacroCommand.

◆ detach()

void ARSTD::MacroCommand::detach ( Command::PtrType  pCommand)

Detaches a command or MacroCommand.

Parameters
pCommandThe command that should be detached.

◆ getName()

std::string ARSTD::MacroCommand::getName ( ) const
virtual

Returns the name of the command.

Returns
The name of the command.

Implements ARSTD::Command.

◆ getProgress()

double ARSTD::MacroCommand::getProgress ( ) const
virtual

Returns the progress of command execution.

Returns
The progress of the execution in range [0, 1].

Reimplemented from ARSTD::Command.

◆ wasExecuted()

bool ARSTD::MacroCommand::wasExecuted ( ) const
virtual

Returns whether the command was already executed.

Returns
Returns true if the command was successfully executed otherwise false. If the progress has not reached 1 (or 100%) false is returned.

Reimplemented from ARSTD::Command.


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