diff --git a/d01/ex03/HumanA.cpp b/d01/ex03/HumanA.cpp index 63fb078..3027f8f 100644 --- a/d01/ex03/HumanA.cpp +++ b/d01/ex03/HumanA.cpp @@ -3,13 +3,18 @@ HumanA::HumanA( std::string name, Weapon weapon ) { this->_name = name; - this->_weapon = &weapon ; + this->_weapon = &weapon; + + return; } -HumanA::~HumanA() {} +HumanA::~HumanA() {return;} void HumanA::attack( void ) { - std::cout << this->_name << " attacks with their " << this->_weapon->getType() << std::endl; + std::cout << this->_name << " attacks with their "; + std::cout << this->_weapon->getType() << std::endl; + + return; } diff --git a/d01/ex03/HumanB.cpp b/d01/ex03/HumanB.cpp index 23eb7c1..de4a171 100644 --- a/d01/ex03/HumanB.cpp +++ b/d01/ex03/HumanB.cpp @@ -7,7 +7,7 @@ HumanB::HumanB( std::string name ) { } HumanB::~HumanB() {} -void setWeapon( Weapon weapon ) { +void HumanB::setWeapon( Weapon weapon ) { this->_weapon = &weapon; diff --git a/d01/ex03/Weapon.cpp b/d01/ex03/Weapon.cpp index 36cab26..74f6132 100644 --- a/d01/ex03/Weapon.cpp +++ b/d01/ex03/Weapon.cpp @@ -3,6 +3,7 @@ Weapon::Weapon( std::string type ) { this->_type = type; + std::cout << "weapon constructor received : " << this->_type << std::endl; } Weapon::~Weapon() {} @@ -10,11 +11,13 @@ Weapon::~Weapon() {} std::string Weapon::getType( void ) { return this->_type; + std::cout << "weapon getType() return : " << this->_type << std::endl; } void Weapon::setType( std::string type ) { this->_type = type; + std::cout << "weapon setType() received : " << this->_type << std::endl; } diff --git a/d01/ex03/Weapon.hpp b/d01/ex03/Weapon.hpp index 9b65b7c..c81c6d2 100644 --- a/d01/ex03/Weapon.hpp +++ b/d01/ex03/Weapon.hpp @@ -11,7 +11,7 @@ public: Weapon( std::string type ); ~Weapon(); - std::string getType( void ); + std::string getType(); void setType( std::string type ); private: diff --git a/d01/ex03/war b/d01/ex03/war new file mode 100755 index 0000000..3aefd0b Binary files /dev/null and b/d01/ex03/war differ