/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* HumanB.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: narnaud +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2022/06/16 09:13:28 by narnaud #+# #+# */ /* Updated: 2022/06/16 10:12:56 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; }