transform d03 ex01 assignation function in case of two constructors, tests of assignation and copy operation not successful
This commit is contained in:
31
d03/ex03/DiamondTrap.cpp
Normal file
31
d03/ex03/DiamondTrap.cpp
Normal 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";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user