cpp-partie-1/cpp01/ex03/HumanB.cpp
2024-02-20 15:35:19 +01:00

28 lines
1.2 KiB
C++

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* HumanB.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: fgras-ca <fgras-ca@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/12/24 17:48:26 by fgras-ca #+# #+# */
/* Updated: 2023/12/24 17:54:54 by fgras-ca ### ########.fr */
/* */
/* ************************************************************************** */
#include "HumanB.hpp"
HumanB::HumanB(std::string name) : _name(name) {}
void HumanB::attack(void)
{
const std::string type = this->_weapon->getType();
std::cout << this->_name << " attacks with their " << type << std::endl;
}
void HumanB::setWeapon(Weapon &weapon)
{
this->_weapon = &weapon;
}
HumanB::~HumanB(void) {}