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

Represents a HumanB, who may or may not have a weapon. [詳解]

#include <HumanB.hpp>

HumanB 連携図
Collaboration graph

公開メンバ関数

 HumanB (std::string name)
 Constructor for the HumanB class.
 
 ~HumanB ()
 Destructor for the HumanB class.
 
void setWeapon (Weapon &weapon)
 Sets the weapon for the HumanB.
 
void attack () const
 Makes the HumanB attack.
 

詳解

Represents a HumanB, who may or may not have a weapon.

HumanB.hpp27 行目に定義があります。

構築子と解体子

◆ HumanB()

HumanB::HumanB ( std::string  name)

Constructor for the HumanB class.

Initializes a HumanB object with a name. The weapon is initially null.

引数
nameThe name of the HumanB.

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

◆ ~HumanB()

HumanB::~HumanB ( )

Destructor for the HumanB class.

HumanB.cpp35 行目に定義があります。

関数詳解

◆ attack()

void HumanB::attack ( ) const

Makes the HumanB attack.

Prints a message indicating the HumanB's name and the type of weapon they are using, or "bare hands" if no weapon is equipped.

HumanB.cpp53 行目に定義があります。

◆ setWeapon()

void HumanB::setWeapon ( Weapon weapon)

Sets the weapon for the HumanB.

引数
weaponA reference to the Weapon the HumanB will use.

HumanB.cpp42 行目に定義があります。


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