cpp03/ex03/FragTrap.cpp

31 lines
797 B
C++

#include "FragTrap.hpp"
#include <iostream>
FragTrap::FragTrap() {
std::cout << "FragTrap::FragTrap()" << std::endl;
hit_points = 100;
energy_points = 100;
attack_damage = 30;
}
FragTrap::FragTrap(std::string name) {
std::cout << "FragTrap::FragTrap(" << name << ")" << std::endl;
hit_points = 100;
energy_points = 100;
attack_damage = 30;
this->name = name;
}
FragTrap::~FragTrap() { std::cout << "FragTrap::~FragTrap()" << std::endl; }
FragTrap &FragTrap::operator=(const FragTrap &other) {
this->hit_points = other.hit_points;
this->energy_points = other.energy_points;
this->attack_damage = other.attack_damage;
this->name = other.name;
return *this;
}
void FragTrap::highFivesGuys() {
std::cout << "FragTrap " << name << ": High-Five Guys?" << std::endl;
}