blob: e6adb22e81d3a5ee3669f7004d6eb5ab3f52e02e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* HumanB.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/02 16:46:02 by cacharle #+# #+# */
/* Updated: 2020/11/09 11:13:34 by cacharle ### ########.fr */
/* */
/* ************************************************************************** */
#include "HumanB.hpp"
HumanB::HumanB(std::string const& name)
: m_name(name), m_weapon(NULL)
{}
void HumanB::attack()
{
if (m_weapon == NULL)
std::cout << m_name << " doesn't have any weapon " << std::endl;
else
std::cout << m_name << " attack with his " << m_weapon->getType() << std::endl;
}
void HumanB::setWeapon(Weapon& weapon)
{
m_weapon = &weapon;
}
|