CPP03 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
DiamondTrap クラス

Represents a DiamondTrap robot, inheriting from both FragTrap and ScavTrap. [詳解]

#include <DiamondTrap.hpp>

DiamondTrap の継承関係図
Inheritance graph
DiamondTrap 連携図
Collaboration graph

公開メンバ関数

 DiamondTrap ()
 Default constructor implementation for DiamondTrap.
 
 DiamondTrap (const std::string &name)
 String constructor implementation for DiamondTrap.
 
 DiamondTrap (const DiamondTrap &other)
 Copy constructor implementation for DiamondTrap.
 
DiamondTrapoperator= (const DiamondTrap &other)
 Copy assignment operator implementation for DiamondTrap.
 
virtual ~DiamondTrap ()
 Virtual destructor implementation for DiamondTrap.
 
void attack (const std::string &target)
 Attack function implementation for DiamondTrap, using ScavTrap's attack.
 
virtual const std::stringgetName () const
 Gets the DiamondTrap's private name.
 
const std::stringgetClapTrapName () const
 Gets the ClapTrap's name associated with the DiamondTrap.
 
void whoAmI ()
 whoAmI function implementation for DiamondTrap.
 
- 基底クラス FragTrap に属する継承公開メンバ関数
 FragTrap ()
 Default constructor implementation for FragTrap.
 
 FragTrap (const std::string &name)
 String constructor implementation for FragTrap.
 
 FragTrap (const FragTrap &other)
 Copy constructor implementation for FragTrap.
 
virtual ~FragTrap ()
 Virtual destructor implementation for FragTrap.
 
FragTrapoperator= (const FragTrap &other)
 
void highFivesGuys (void)
 highFivesGuys function implementation for FragTrap.
 
 FragTrap ()
 
 FragTrap (const std::string &name)
 
 FragTrap (const FragTrap &other)
 
FragTrapoperator= (const FragTrap &other)
 
virtual ~FragTrap ()
 
void highFivesGuys (void)
 
- 基底クラス ClapTrap に属する継承公開メンバ関数
 ClapTrap ()
 Default constructor implementation.
 
 ClapTrap (const std::string &name)
 String constructor implementation.
 
 ClapTrap (const ClapTrap &other)
 Copy constructor implementation.
 
 ~ClapTrap ()
 Destructor implementation.
 
ClapTrapoperator= (const ClapTrap &other)
 Copy assignment operator implementation.
 
void attack (const std::string &target)
 Attack function implementation.
 
void takeDamage (unsigned int amount)
 takeDamage function implementation.
 
void beRepaired (unsigned int amount)
 beRepaired function implementation.
 
const std::stringgetName () const
 Gets the name of the ClapTrap.
 
unsigned int getHitPoints () const
 Gets the current hit points of the ClapTrap.
 
unsigned int getEnergyPoints () const
 Gets the current energy points of the ClapTrap.
 
unsigned int getAttackDamage () const
 Gets the attack damage of the ClapTrap.
 
 ClapTrap ()
 
 ClapTrap (const std::string &name)
 
 ClapTrap (const ClapTrap &other)
 
virtual ~ClapTrap ()
 Destructor implementation.
 
ClapTrapoperator= (const ClapTrap &other)
 
void takeDamage (unsigned int amount)
 
void beRepaired (unsigned int amount)
 
const std::stringgetName () const
 Gets the name of the ClapTrap.
 
unsigned int getHitPoints () const
 Gets the current hit points of the ClapTrap.
 
unsigned int getEnergyPoints () const
 Gets the current energy points of the ClapTrap.
 
unsigned int getAttackDamage () const
 Gets the attack damage of the ClapTrap.
 
 ClapTrap ()
 
 ClapTrap (const std::string &name)
 
 ClapTrap (const ClapTrap &other)
 
virtual ~ClapTrap ()
 Destructor implementation.
 
ClapTrapoperator= (const ClapTrap &other)
 
void takeDamage (unsigned int amount)
 
void beRepaired (unsigned int amount)
 
const std::stringgetName () const
 Gets the name of the ClapTrap.
 
unsigned int getHitPoints () const
 Gets the current hit points of the ClapTrap.
 
unsigned int getEnergyPoints () const
 Gets the current energy points of the ClapTrap.
 
unsigned int getAttackDamage () const
 Gets the attack damage of the ClapTrap.
 
 ClapTrap ()
 
 ClapTrap (const std::string &name)
 
 ClapTrap (const ClapTrap &other)
 
 ClapTrap (const std::string &name, unsigned int hp, unsigned int ep, unsigned int ad)
 Constructor for the ClapTrap class with specified attributes.
 
ClapTrapoperator= (const ClapTrap &other)
 
virtual ~ClapTrap ()
 
void takeDamage (unsigned int amount)
 
void beRepaired (unsigned int amount)
 
unsigned int getHitPoints () const
 
unsigned int getEnergyPoints () const
 
unsigned int getAttackDamage () const
 
- 基底クラス ScavTrap に属する継承公開メンバ関数
 ScavTrap ()
 Default constructor implementation for ScavTrap.
 
 ScavTrap (const std::string &name)
 String constructor implementation for ScavTrap.
 
 ScavTrap (const ScavTrap &other)
 Copy constructor implementation for ScavTrap.
 
virtual ~ScavTrap ()
 Virtual destructor implementation for ScavTrap.
 
ScavTrapoperator= (const ScavTrap &other)
 Copy assignment operator implementation for ScavTrap.
 
void guardGate ()
 guardGate function implementation for ScavTrap.
 
 ScavTrap ()
 
 ScavTrap (const std::string &name)
 
 ScavTrap (const ScavTrap &other)
 
virtual ~ScavTrap ()
 
ScavTrapoperator= (const ScavTrap &other)
 
void guardGate ()
 
 ScavTrap ()
 
 ScavTrap (const std::string &name)
 
 ScavTrap (const ScavTrap &other)
 
ScavTrapoperator= (const ScavTrap &other)
 
virtual ~ScavTrap ()
 
void guardGate ()
 

静的公開変数類

static const unsigned int defaultHitPoints = FragTrap::defaultHitPoints
 
static const unsigned int defaultEnergyPoints = ScavTrap::defaultEnergyPoints
 
static const unsigned int defaultAttackDamage = FragTrap::defaultAttackDamage
 
- 基底クラス FragTrap に属する継承静的公開変数類
static const unsigned int defaultHitPoints = 100
 
static const unsigned int defaultEnergyPoints = 100
 
static const unsigned int defaultAttackDamage = 30
 
- 基底クラス ClapTrap に属する継承静的公開変数類
static const unsigned int defaultHitPoints = 10
 
static const unsigned int defaultEnergyPoints = 10
 
static const unsigned int defaultAttackDamage = 0
 
- 基底クラス ScavTrap に属する継承静的公開変数類
static const unsigned int defaultHitPoints = 100
 
static const unsigned int defaultEnergyPoints = 50
 
static const unsigned int defaultAttackDamage = 20
 

詳解

Represents a DiamondTrap robot, inheriting from both FragTrap and ScavTrap.

DiamondTrap inherits hit points and attack damage from FragTrap, energy points and the attack method from ScavTrap. It also has its own private name and a unique 'whoAmI' function to display both its DiamondTrap name and ClapTrap name.

DiamondTrap.hpp39 行目に定義があります。

構築子と解体子

◆ DiamondTrap() [1/3]

DiamondTrap::DiamondTrap ( )

Default constructor implementation for DiamondTrap.

DiamondTrap.cpp28 行目に定義があります。

◆ DiamondTrap() [2/3]

DiamondTrap::DiamondTrap ( const std::string newName)

String constructor implementation for DiamondTrap.

引数
newNameThe name for the DiamondTrap.

hitPoints : FragTrap (100), energyPoints : ScavTrap (50), attackDamage : FragTrap (30)

DiamondTrap.cpp45 行目に定義があります。

◆ DiamondTrap() [3/3]

DiamondTrap::DiamondTrap ( const DiamondTrap other)

Copy constructor implementation for DiamondTrap.

引数
otherThe DiamondTrap object to copy.

DiamondTrap.cpp58 行目に定義があります。

◆ ~DiamondTrap()

DiamondTrap::~DiamondTrap ( )
virtual

Virtual destructor implementation for DiamondTrap.

DiamondTrap.cpp67 行目に定義があります。

関数詳解

◆ attack()

void DiamondTrap::attack ( const std::string target)
virtual

Attack function implementation for DiamondTrap, using ScavTrap's attack.

引数
targetThe target of the attack.

FragTrapを再実装しています。

DiamondTrap.cpp87 行目に定義があります。

◆ getClapTrapName()

const std::string & DiamondTrap::getClapTrapName ( ) const

Gets the ClapTrap's name associated with the DiamondTrap.

戻り値
A constant reference to the ClapTrap's name.

DiamondTrap.cpp101 行目に定義があります。

◆ getName()

const std::string & DiamondTrap::getName ( ) const
virtual

Gets the DiamondTrap's private name.

戻り値
A constant reference to the DiamondTrap's name.

ClapTrapを再実装しています。

DiamondTrap.cpp95 行目に定義があります。

◆ operator=()

DiamondTrap & DiamondTrap::operator= ( const DiamondTrap other)

Copy assignment operator implementation for DiamondTrap.

引数
otherThe DiamondTrap object to assign from.
戻り値
A reference to the assigned DiamondTrap object.

DiamondTrap.cpp74 行目に定義があります。

◆ whoAmI()

void DiamondTrap::whoAmI ( )

whoAmI function implementation for DiamondTrap.

Displays both the DiamondTrap's private name and its ClapTrap name.

DiamondTrap.cpp108 行目に定義があります。

メンバ詳解

◆ defaultAttackDamage

const unsigned int DiamondTrap::defaultAttackDamage = FragTrap::defaultAttackDamage
static

DiamondTrap.hpp43 行目に定義があります。

◆ defaultEnergyPoints

const unsigned int DiamondTrap::defaultEnergyPoints = ScavTrap::defaultEnergyPoints
static

DiamondTrap.hpp42 行目に定義があります。

◆ defaultHitPoints

const unsigned int DiamondTrap::defaultHitPoints = FragTrap::defaultHitPoints
static

DiamondTrap.hpp41 行目に定義があります。


このクラス詳解は次のファイルから抽出されました: