feat(ex03): it works
This commit is contained in:
parent
5cd051a7f7
commit
7fb5f99a7a
11 changed files with 320 additions and 0 deletions
31
ex03/FragTrap.cpp
Normal file
31
ex03/FragTrap.cpp
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
#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;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue