fix(norm): add copy contructor
This commit is contained in:
parent
7fb5f99a7a
commit
57de4fa948
20 changed files with 93 additions and 0 deletions
|
|
@ -11,6 +11,15 @@ DiamondTrap::DiamondTrap() : FragTrap(), ScavTrap() {
|
|||
ClapTrap::name = name + "_clap_name";
|
||||
std::cout << "DiamondTrap::DiamondTrap()" << std::endl;
|
||||
}
|
||||
|
||||
DiamondTrap::DiamondTrap(const DiamondTrap &other) {
|
||||
name = other.name;
|
||||
hit_points = other.hit_points;
|
||||
energy_points = other.energy_points;
|
||||
attack_damage = other.attack_damage;
|
||||
std::cout << "DiamondTrap::DiamondTrap(const DiamondTrap &other)" << std::endl;
|
||||
}
|
||||
|
||||
DiamondTrap::DiamondTrap(std::string name) : name(name) {
|
||||
const FragTrap fragtrap = FragTrap(name);
|
||||
|
||||
|
|
@ -21,11 +30,13 @@ DiamondTrap::DiamondTrap(std::string name) : name(name) {
|
|||
ClapTrap::name = name + "_clap_name";
|
||||
std::cout << "DiamondTrap::DiamondTrap(" << name << ")" << std::endl;
|
||||
}
|
||||
|
||||
DiamondTrap &DiamondTrap::operator=(DiamondTrap &other) {
|
||||
this->name = other.name;
|
||||
ClapTrap::operator=(other);
|
||||
return *this;
|
||||
}
|
||||
|
||||
DiamondTrap::~DiamondTrap() {}
|
||||
|
||||
void DiamondTrap::whoAmI() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue