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.
34 lines
1.2 KiB
34 lines
1.2 KiB
3 years ago
|
/* ************************************************************************** */
|
||
|
/* */
|
||
|
/* ::: :::::::: */
|
||
|
/* HumanB.cpp :+: :+: :+: */
|
||
|
/* +:+ +:+ +:+ */
|
||
|
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
|
||
|
/* +#+#+#+#+#+ +#+ */
|
||
|
/* 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;
|
||
|
}
|