You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
|
|
|
/* ::: :::::::: */
|
|
|
|
/* HumanB.cpp :+: :+: :+: */
|
|
|
|
/* +:+ +:+ +:+ */
|
|
|
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
|
|
|
/* +#+#+#+#+#+ +#+ */
|
|
|
|
/* Created: 2022/06/16 09:13:28 by narnaud #+# #+# */
|
|
|
|
/* Updated: 2022/07/18 10:05:32 by narnaud ### ########.fr */
|
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
|
|
#include "HumanB.hpp"
|
|
|
|
|
|
|
|
|
|
|
|
HumanB::HumanB(string name):_name(name), _weapon(NULL){}
|
|
|
|
|
|
|
|
HumanB::HumanB(string name, Weapon &weap):_name(name), _weapon(&weap){}
|
|
|
|
|
|
|
|
void HumanB::attack(void) const {
|
|
|
|
std::cout << _name << " attacks with their ";
|
|
|
|
if (_weapon)
|
|
|
|
cout << _weapon->getType() << endl;
|
|
|
|
else
|
|
|
|
cout << "fists\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
void HumanB::setWeapon(Weapon &weap) {
|
|
|
|
_weapon = &weap;
|
|
|
|
}
|