15 lines
404 B
C++
15 lines
404 B
C++
#include "HumanB.hpp"
|
|
#include <iostream>
|
|
|
|
HumanB::HumanB(std::string name) : name(name) { this->weapon = NULL; }
|
|
|
|
void HumanB::setWeapon(Weapon &weapon) { this->weapon = &weapon; }
|
|
|
|
void HumanB::attack(void) {
|
|
std::string weaponType;
|
|
if (weapon != NULL)
|
|
weaponType = weapon->getType();
|
|
else
|
|
weaponType = "hands";
|
|
std::cout << name << " attacks with their " << weaponType << std::endl;
|
|
}
|