d01 ex03 ref and ptr
This commit is contained in:
@@ -7,7 +7,7 @@ HumanB::HumanB( std::string name ) {
|
||||
}
|
||||
HumanB::~HumanB() {}
|
||||
|
||||
void HumanB::setWeapon( Weapon weapon ) {
|
||||
void HumanB::setWeapon( Weapon &weapon ) {
|
||||
|
||||
this->_weapon = &weapon;
|
||||
|
||||
@@ -15,7 +15,8 @@ void HumanB::setWeapon( Weapon weapon ) {
|
||||
|
||||
void HumanB::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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user