fix(norm): add copy contructor

This commit is contained in:
Khaïs COLIN 2025-05-27 13:39:30 +02:00
parent 7fb5f99a7a
commit 57de4fa948
Signed by: logistic-bot
SSH key fingerprint: SHA256:RlpiqKeXpcPFZZ4y9Ou4xi2M8OhRJovIwDlbCaMsuAo
20 changed files with 93 additions and 0 deletions

View file

@ -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() {