CPP01 1.0
|
Represents a HumanB, who may or may not have a weapon. [詳解]
#include <HumanB.hpp>
公開メンバ関数 | |
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.hpp の 27 行目に定義があります。
HumanB::HumanB | ( | std::string | name | ) |
Constructor for the HumanB class.
Initializes a HumanB object with a name. The weapon is initially null.
name | The name of the HumanB. |
HumanB.cpp の 28 行目に定義があります。
HumanB::~HumanB | ( | ) |
Destructor for the HumanB class.
HumanB.cpp の 35 行目に定義があります。
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.cpp の 53 行目に定義があります。
void HumanB::setWeapon | ( | Weapon & | weapon | ) |
Sets the weapon for the HumanB.
HumanB.cpp の 42 行目に定義があります。