From 0f3240844dbd5a874e1565a988ef355ededab6a5 Mon Sep 17 00:00:00 2001 From: Charles Date: Mon, 13 Apr 2020 10:33:05 +0200 Subject: Fixing cpp01 --- cpp01/ex06/HumanB.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cpp01/ex06/HumanB.cpp') diff --git a/cpp01/ex06/HumanB.cpp b/cpp01/ex06/HumanB.cpp index e08363c..98774aa 100644 --- a/cpp01/ex06/HumanB.cpp +++ b/cpp01/ex06/HumanB.cpp @@ -6,23 +6,23 @@ /* By: cacharle +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/02 16:46:02 by cacharle #+# #+# */ -/* Updated: 2020/02/02 16:54:33 by cacharle ### ########.fr */ +/* Updated: 2020/04/13 10:25:54 by charles ### ########.fr */ /* */ /* ************************************************************************** */ #include "HumanB.hpp" HumanB::HumanB(std::string name) + : m_name(name), m_weapon(NULL) { - this->name = name; } void HumanB::attack() { - std::cout << name << " attack with his " << weapon.getType(); + std::cout << m_name << " attack with his " << m_weapon->getType() << std::endl; } -void HumanB::setWeapon(Weapon weapon) +void HumanB::setWeapon(Weapon& weapon) { - this->weapon = weapon; + m_weapon = &weapon; } -- cgit