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

Represents a ScavTrap robot, a specialized type derived from ClapTrap. [詳解]

#include <ScavTrap.hpp>

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

公開メンバ関数

 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.
 
virtual void attack (const std::string &target)
 Attack function 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)
 
virtual void attack (const std::string &target)
 Attack function implementation.
 
void guardGate ()
 
 ScavTrap ()
 
 ScavTrap (const std::string &name)
 
 ScavTrap (const ScavTrap &other)
 
ScavTrapoperator= (const ScavTrap &other)
 
virtual ~ScavTrap ()
 
virtual void attack (const std::string &target)
 Attack function implementation.
 
void guardGate ()
 
- 基底クラス 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)
 
virtual const std::stringgetName () const
 
unsigned int getHitPoints () const
 
unsigned int getEnergyPoints () const
 
unsigned int getAttackDamage () const
 

静的公開変数類

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

詳解

Represents a ScavTrap robot, a specialized type derived from ClapTrap.

ScavTrap inherits from ClapTrap but has different default attributes (hit points: 100, energy points: 50, attack damage: 20) and a unique 'guardGate' functionality. Its constructors, destructor, and attack() method also print distinct messages.

ScavTrap.hpp38 行目に定義があります。

構築子と解体子

◆ ScavTrap() [1/9]

ScavTrap::ScavTrap ( )

Default constructor implementation for ScavTrap.

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

◆ ScavTrap() [2/9]

ScavTrap::ScavTrap ( const std::string newName)

String constructor implementation for ScavTrap.

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

ScavTrap.cpp40 行目に定義があります。

◆ ScavTrap() [3/9]

ScavTrap::ScavTrap ( const ScavTrap other)

Copy constructor implementation for ScavTrap.

引数
otherThe ScavTrap object to copy.

ScavTrap.cpp51 行目に定義があります。

◆ ~ScavTrap() [1/3]

ScavTrap::~ScavTrap ( )
virtual

Virtual destructor implementation for ScavTrap.

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

◆ ScavTrap() [4/9]

ScavTrap::ScavTrap ( )

◆ ScavTrap() [5/9]

ScavTrap::ScavTrap ( const std::string name)

◆ ScavTrap() [6/9]

ScavTrap::ScavTrap ( const ScavTrap other)

◆ ~ScavTrap() [2/3]

virtual ScavTrap::~ScavTrap ( )
virtual

◆ ScavTrap() [7/9]

ScavTrap::ScavTrap ( )

◆ ScavTrap() [8/9]

ScavTrap::ScavTrap ( const std::string name)

◆ ScavTrap() [9/9]

ScavTrap::ScavTrap ( const ScavTrap other)

◆ ~ScavTrap() [3/3]

virtual ScavTrap::~ScavTrap ( )
virtual

関数詳解

◆ attack() [1/3]

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

Attack function implementation for ScavTrap.

引数
targetThe target of the attack.

ClapTrapを再実装しています。

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

ScavTrap.cpp77 行目に定義があります。

◆ attack() [2/3]

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

Attack function implementation.

ClapTrapを再実装しています。

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

◆ attack() [3/3]

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

Attack function implementation.

ClapTrapを再実装しています。

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

◆ guardGate() [1/3]

void ScavTrap::guardGate ( )

guardGate function implementation for ScavTrap.

ScavTrap.cpp92 行目に定義があります。

◆ guardGate() [2/3]

void ScavTrap::guardGate ( )

◆ guardGate() [3/3]

void ScavTrap::guardGate ( )

◆ operator=() [1/3]

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

Copy assignment operator implementation for ScavTrap.

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

ScavTrap.cpp65 行目に定義があります。

◆ operator=() [2/3]

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

◆ operator=() [3/3]

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

メンバ詳解

◆ defaultAttackDamage

const unsigned int ScavTrap::defaultAttackDamage = 20
static

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

◆ defaultEnergyPoints

const unsigned int ScavTrap::defaultEnergyPoints = 50
static

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

◆ defaultHitPoints

const unsigned int ScavTrap::defaultHitPoints = 100
static

ScavTrap.hpp40 行目に定義があります。


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