#include "Cat.hpp" #define COPLIEN_COLOR B_CYAN /********************************************* * CONSTRUCTORS *********************************************/ Cat::Cat( Brain * brain ) { std::cout << COPLIEN_COLOR "Cat constructor" RESET "\n"; type = "cat"; _brain = brain; return; } Cat::Cat( Cat const & src ) { std::cout << COPLIEN_COLOR "Cat copy constructor" RESET "\n"; *this = src; return; } /********************************************* * DESTRUCTORS *********************************************/ Cat::~Cat() { std::cout << COPLIEN_COLOR "Cat destructor" RESET "\n"; return; } /********************************************* * OPERATORS *********************************************/ Cat & Cat::operator=( Cat const & rhs ) { std::cout << COPLIEN_COLOR "Cat assignator" RESET "\n"; Animal::operator=(rhs); *_brain = *rhs._brain; return *this; } /********************************************* * PUBLIC MEMBER FUNCTIONS *********************************************/ void Cat::makeSound() const { std::cout << "*miaow*\n"; } void Cat::printBrain() const { _brain->printIdeas(); } void Cat::printBrain(int pos) const { _brain->printIdea(pos); }