1
0
This repository has been archived on 2025-01-26. You can view files and clone it, but cannot push or open issues or pull requests.

49 lines
1.6 KiB
C++
Raw Normal View History

2024-12-06 16:24:15 +01:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* Cat.cpp :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/12/01 19:49:11 by adjoly #+# #+# */
/* Updated: 2024/12/06 16:09:23 by adjoly ### ########.fr */
/* */
/* ************************************************************************** */
#include "Cat.hpp"
Cat::Cat(void) : AAnimal("Cat"){
_brain = new Brain();
log("", "Cat", "", "construtor called");
}
Cat::~Cat(void) {
delete _brain;
log("", "Cat", "", "destructor called");
}
Cat::Cat(const Cat &cpy) : AAnimal("Cat"){
log("", "Cat", _type, "copy construtor called");
*this = cpy;
}
Cat &Cat::operator=(const Cat &cpy) {
log("🟰", "Cat", "", "copy assignment construtor called");
if (this != &cpy) {
this->_type = cpy._type;
}
return (*this);
}
void Cat::makeSound(void) const {
log("🔊", "Cat", "", "Mmmmmmeeeeeeeeoooooooowwwwww");
}
void Cat::setIdea(std::string idea, uint i) {
_brain->_ideas[i] = idea;
}
std::string Cat::getIdea(uint i) {
return (_brain->_ideas[i]);
}