26 lines
408 B
C++
26 lines
408 B
C++
#include "Animal.hpp"
|
|
|
|
Animal::Animal() {
|
|
std::cout << "Animal born" << std::endl;
|
|
this->type = "Animal";
|
|
}
|
|
|
|
Animal::Animal(const Animal &other) {
|
|
*this = other;
|
|
}
|
|
|
|
Animal& Animal::operator=(const Animal &other) {
|
|
if (this != &other) {
|
|
this->type = other.type;
|
|
}
|
|
return (*this);
|
|
}
|
|
|
|
Animal::~Animal() {
|
|
std::cout << "Animal die" << std::endl;
|
|
}
|
|
|
|
std::string Animal::getType() const {
|
|
return type;
|
|
}
|