en cours de debug d01 ex03
This commit is contained in:
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ HumanB::HumanB( std::string name ) {
|
||||
}
|
||||
HumanB::~HumanB() {}
|
||||
|
||||
void setWeapon( Weapon weapon ) {
|
||||
void HumanB::setWeapon( Weapon weapon ) {
|
||||
|
||||
this->_weapon = &weapon;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -11,7 +11,7 @@ public:
|
||||
Weapon( std::string type );
|
||||
~Weapon();
|
||||
|
||||
std::string getType( void );
|
||||
std::string getType();
|
||||
void setType( std::string type );
|
||||
|
||||
private:
|
||||
|
||||
BIN
d01/ex03/war
Executable file
BIN
d01/ex03/war
Executable file
Binary file not shown.
Reference in New Issue
Block a user