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

Represents a basic robot character. [詳解]

#include <ClapTrap.hpp>

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

公開メンバ関数

 ClapTrap ()
 Default constructor implementation.
 
 ClapTrap (const std::string &name)
 String constructor implementation.
 
 ClapTrap (const ClapTrap &other)
 Copy constructor implementation.
 
 ~ClapTrap ()
 Destructor implementation.
 
ClapTrap & operator= (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::string & getName () 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.
 
ClapTrap & operator= (const ClapTrap &other)
 
virtual void attack (const std::string &target)
 Attack function implementation.
 
void takeDamage (unsigned int amount)
 
void beRepaired (unsigned int amount)
 
const std::string & getName () 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.
 
ClapTrap & operator= (const ClapTrap &other)
 
virtual void attack (const std::string &target)
 Attack function implementation.
 
void takeDamage (unsigned int amount)
 
void beRepaired (unsigned int amount)
 
const std::string & getName () 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.
 
ClapTrap & operator= (const ClapTrap &other)
 
virtual ~ClapTrap ()
 
virtual void attack (const std::string &target)
 
void takeDamage (unsigned int amount)
 
void beRepaired (unsigned int amount)
 
virtual const std::string & getName () const
 
unsigned int getHitPoints () const
 
unsigned int getEnergyPoints () const
 
unsigned int getAttackDamage () const
 

静的公開変数類

static const unsigned int defaultHitPoints = 10
 
static const unsigned int defaultEnergyPoints = 10
 
static const unsigned int defaultAttackDamage = 0
 

詳解

Represents a basic robot character.

The ClapTrap class has attributes for name, hit points, energy points, and attack damage. It provides functionalities for attacking, taking damage, and repairing itself.

ClapTrap.hpp の 34 行目に定義があります。

構築子と解体子

◆ ClapTrap() [1/13]

ClapTrap::ClapTrap ( )

Default constructor implementation.

ClapTrap.cpp の 27 行目に定義があります。

◆ ClapTrap() [2/13]

ClapTrap::ClapTrap ( const std::string &  newName)

String constructor implementation.

引数
nameThe name for the ClapTrap.
newNameThe newName for the ClapTrap.

ClapTrap.cpp の 35 行目に定義があります。

◆ ClapTrap() [3/13]

ClapTrap::ClapTrap ( const ClapTrap &  other)

Copy constructor implementation.

引数
otherThe ClapTrap object to copy.

ClapTrap.cpp の 43 行目に定義があります。

◆ ~ClapTrap() [1/4]

ClapTrap::~ClapTrap ( )

Destructor implementation.

ClapTrap.cpp の 51 行目に定義があります。

◆ ClapTrap() [4/13]

ClapTrap::ClapTrap ( )

◆ ClapTrap() [5/13]

ClapTrap::ClapTrap ( const std::string &  name)

◆ ClapTrap() [6/13]

ClapTrap::ClapTrap ( const ClapTrap &  other)

◆ ~ClapTrap() [2/4]

virtual ClapTrap::~ClapTrap ( )
virtual

Destructor implementation.

◆ ClapTrap() [7/13]

ClapTrap::ClapTrap ( )

◆ ClapTrap() [8/13]

ClapTrap::ClapTrap ( const std::string &  name)

◆ ClapTrap() [9/13]

ClapTrap::ClapTrap ( const ClapTrap &  other)

◆ ~ClapTrap() [3/4]

virtual ClapTrap::~ClapTrap ( )
virtual

Destructor implementation.

◆ ClapTrap() [10/13]

ClapTrap::ClapTrap ( )

◆ ClapTrap() [11/13]

ClapTrap::ClapTrap ( const std::string &  name)

◆ ClapTrap() [12/13]

ClapTrap::ClapTrap ( const ClapTrap &  other)

◆ ClapTrap() [13/13]

ClapTrap::ClapTrap ( const std::string &  newName,
unsigned int  hp,
unsigned int  ep,
unsigned int  ad 
)

Constructor for the ClapTrap class with specified attributes.

引数
newNameThe newName to assign to the ClapTrap.
hpThe initial hit points of the ClapTrap.
epThe initial energy points of the ClapTrap.
adThe initial attack damage of the ClapTrap.

Initializes a ClapTrap object with the given newName, hit points, energy points, and attack damage.

ClapTrap.cpp の 67 行目に定義があります。

◆ ~ClapTrap() [4/4]

virtual ClapTrap::~ClapTrap ( )
virtual

関数詳解

◆ attack() [1/4]

void ClapTrap::attack ( const std::string &  target)

Attack function implementation.

引数
targetThe target of the attack.

ClapTrap.cpp の 73 行目に定義があります。

◆ attack() [2/4]

virtual void ClapTrap::attack ( const std::string &  target)
virtual

Attack function implementation.

ScavTrap, FragTrap, ScavTrap, DiamondTrap, FragTrap, ScavTrapで再実装されています。

◆ attack() [3/4]

virtual void ClapTrap::attack ( const std::string &  target)
virtual

Attack function implementation.

ScavTrap, FragTrap, ScavTrap, DiamondTrap, FragTrap, ScavTrapで再実装されています。

◆ attack() [4/4]

virtual void ClapTrap::attack ( const std::string &  target)
virtual

ScavTrap, FragTrap, ScavTrap, DiamondTrap, FragTrap, ScavTrapで再実装されています。

◆ beRepaired() [1/4]

void ClapTrap::beRepaired ( unsigned int  amount)

beRepaired function implementation.

引数
amountThe amount of hit points to regain.

ClapTrap.cpp の 108 行目に定義があります。

◆ beRepaired() [2/4]

void ClapTrap::beRepaired ( unsigned int  amount)

◆ beRepaired() [3/4]

void ClapTrap::beRepaired ( unsigned int  amount)

◆ beRepaired() [4/4]

void ClapTrap::beRepaired ( unsigned int  amount)

◆ getAttackDamage() [1/4]

unsigned int ClapTrap::getAttackDamage ( ) const

Gets the attack damage of the ClapTrap.

戻り値
The attack damage.

ClapTrap.cpp の 144 行目に定義があります。

◆ getAttackDamage() [2/4]

unsigned int ClapTrap::getAttackDamage ( ) const

Gets the attack damage of the ClapTrap.

◆ getAttackDamage() [3/4]

unsigned int ClapTrap::getAttackDamage ( ) const

Gets the attack damage of the ClapTrap.

◆ getAttackDamage() [4/4]

unsigned int ClapTrap::getAttackDamage ( ) const

◆ getEnergyPoints() [1/4]

unsigned int ClapTrap::getEnergyPoints ( ) const

Gets the current energy points of the ClapTrap.

戻り値
The current energy points.

ClapTrap.cpp の 138 行目に定義があります。

◆ getEnergyPoints() [2/4]

unsigned int ClapTrap::getEnergyPoints ( ) const

Gets the current energy points of the ClapTrap.

◆ getEnergyPoints() [3/4]

unsigned int ClapTrap::getEnergyPoints ( ) const

Gets the current energy points of the ClapTrap.

◆ getEnergyPoints() [4/4]

unsigned int ClapTrap::getEnergyPoints ( ) const

◆ getHitPoints() [1/4]

unsigned int ClapTrap::getHitPoints ( ) const

Gets the current hit points of the ClapTrap.

戻り値
The current hit points.

ClapTrap.cpp の 132 行目に定義があります。

◆ getHitPoints() [2/4]

unsigned int ClapTrap::getHitPoints ( ) const

Gets the current hit points of the ClapTrap.

◆ getHitPoints() [3/4]

unsigned int ClapTrap::getHitPoints ( ) const

Gets the current hit points of the ClapTrap.

◆ getHitPoints() [4/4]

unsigned int ClapTrap::getHitPoints ( ) const

◆ getName() [1/4]

const std::string & ClapTrap::getName ( ) const

Gets the name of the ClapTrap.

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

ClapTrap.cpp の 126 行目に定義があります。

◆ getName() [2/4]

const std::string & ClapTrap::getName ( ) const

Gets the name of the ClapTrap.

◆ getName() [3/4]

const std::string & ClapTrap::getName ( ) const

Gets the name of the ClapTrap.

◆ getName() [4/4]

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

DiamondTrapで再実装されています。

◆ operator=() [1/4]

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

Copy assignment operator implementation.

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

ClapTrap.cpp の 58 行目に定義があります。

◆ operator=() [2/4]

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

◆ operator=() [3/4]

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

◆ operator=() [4/4]

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

◆ takeDamage() [1/4]

void ClapTrap::takeDamage ( unsigned int  amount)

takeDamage function implementation.

引数
amountThe amount of damage taken.

ClapTrap.cpp の 89 行目に定義があります。

◆ takeDamage() [2/4]

void ClapTrap::takeDamage ( unsigned int  amount)

◆ takeDamage() [3/4]

void ClapTrap::takeDamage ( unsigned int  amount)

◆ takeDamage() [4/4]

void ClapTrap::takeDamage ( unsigned int  amount)

メンバ詳解

◆ defaultAttackDamage

const unsigned int ClapTrap::defaultAttackDamage = 0
static

ClapTrap.hpp の 44 行目に定義があります。

◆ defaultEnergyPoints

const unsigned int ClapTrap::defaultEnergyPoints = 10
static

ClapTrap.hpp の 43 行目に定義があります。

◆ defaultHitPoints

const unsigned int ClapTrap::defaultHitPoints = 10
static

ClapTrap.hpp の 42 行目に定義があります。


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