transform d03 ex01 assignation function in case of two constructors, tests of assignation and copy operation not successful

This commit is contained in:
Hugo LAMY
2022-02-19 12:01:43 +01:00
parent 817fac957b
commit 7e65467a27
10 changed files with 104 additions and 23 deletions

31
d03/ex03/DiamondTrap.cpp Normal file
View File

@@ -0,0 +1,31 @@
#include "DiamondTrap.hpp"
DiamondTrap::~DiamondTrap( std::string name ) : ScavTrap(name), FragTrap(name) {
_class = "FragTrap";
_hit = 100;
_energy = 100;
_attack = 30;
std::cout << _class << " " << FragTrap::_name << " created with number " << _number << "\n";
return;
}
/*
* destructor
*/
DiamondTrap::~DiamondTrap( void ) {
std::cout << _class << " " << DiamondTrap::_name << " destructed\n";
return;
}
/*
* special capacity
*/
void DiamondTrap::highFivesGuys() {
std::cout << _class << " " << DiamondTrap::_name << " wait for a high fives, common guys\n";
}