/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Cat.cpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: fgras-ca +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/12/31 12:52:48 by fgras-ca #+# #+# */ /* Updated: 2023/12/31 15:26:47 by fgras-ca ### ########.fr */ /* */ /* ************************************************************************** */ #include "Cat.hpp" Cat::Cat() { this->type = "Cat"; this->brain = new Brain(); std::cout << GREEN << "Cat default constructor called. Type is set to " << type << "." << RESET << std::endl; } Cat::Cat(const Cat ©) : Animal(copy), brain(new Brain(*copy.brain)) { std::cout << CYAN << "Cat copy constructor called. Type is " << type << "." << RESET << std::endl; } Cat& Cat::operator=(const Cat &operator_aff) { Animal::operator=(operator_aff); std::cout << MAGENTA << "Cat assignment operator called. Type is now " << type << "." << RESET << std::endl; return (*this); } Cat::~Cat() { std::cout << RED << "Cat destructor called. Type was " << type << "." << RESET << std::endl; } void Cat::makeSound() const { std::cout << "Miaouhh! Miaouhh!" << std::endl; } Brain* Cat::getBrain(void) const { return (this->brain); }