aboutsummaryrefslogtreecommitdiff
path: root/cpp01/ex06/HumanA.cpp
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-04-13 10:33:05 +0200
committerCharles <sircharlesaze@gmail.com>2020-04-13 10:33:05 +0200
commit0f3240844dbd5a874e1565a988ef355ededab6a5 (patch)
treeefc1a1307863d173be17a12fbab6b84fe7d00960 /cpp01/ex06/HumanA.cpp
parent629d52b1262879a346e9ca17567a8f483c60ba0a (diff)
downloadpiscine_cpp-0f3240844dbd5a874e1565a988ef355ededab6a5.tar.gz
piscine_cpp-0f3240844dbd5a874e1565a988ef355ededab6a5.tar.bz2
piscine_cpp-0f3240844dbd5a874e1565a988ef355ededab6a5.zip
Fixing cpp01
Diffstat (limited to 'cpp01/ex06/HumanA.cpp')
-rw-r--r--cpp01/ex06/HumanA.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/cpp01/ex06/HumanA.cpp b/cpp01/ex06/HumanA.cpp
index 8d9b449..7e52494 100644
--- a/cpp01/ex06/HumanA.cpp
+++ b/cpp01/ex06/HumanA.cpp
@@ -6,19 +6,18 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/02 16:44:03 by cacharle #+# #+# */
-/* Updated: 2020/02/02 16:54:07 by cacharle ### ########.fr */
+/* Updated: 2020/04/13 10:26:03 by charles ### ########.fr */
/* */
/* ************************************************************************** */
#include "HumanA.hpp"
-HumanA::HumanA(std::string name, Weapon weapon)
+HumanA::HumanA(std::string name, Weapon& weapon)
+ : m_name(name), m_weapon(weapon)
{
- this->name = name;
- this->weapon = weapon;
}
void HumanA::attack()
{
- std::cout << name << " attack with his " << weapon.getType();
+ std::cout << m_name << " attack with his " << m_weapon.getType() << std::endl;
}