update: rm -rf to restart from scratch
This commit is contained in:
parent
42e83d8e62
commit
5e999def3a
45 changed files with 813 additions and 366 deletions
|
|
@ -5,25 +5,50 @@
|
|||
/* +:+ +:+ +:+ */
|
||||
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2025/01/30 13:40:30 by rparodi #+# #+# */
|
||||
/* Updated: 2025/02/10 12:19:22 by rparodi ### ########.fr */
|
||||
/* Created: 2025/02/18 16:22:02 by rparodi #+# #+# */
|
||||
/* Updated: 2025/02/18 20:07:55 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "Dog.hpp"
|
||||
#include "Brain.hpp"
|
||||
#include <iostream>
|
||||
|
||||
Dog::Dog() {
|
||||
std::cout << "[Dog]\t\tCreating the class" << std::endl;
|
||||
std::cout << "[Dog]\t\tCreating Dog class" << std::endl;
|
||||
type = "Dog";
|
||||
brain = new Brain();
|
||||
}
|
||||
|
||||
Dog::Dog(Dog const & copy) {
|
||||
std::cout << "[Dog]\t\tCreating Dog class (copy)" << std::endl;
|
||||
this->type = copy.type;
|
||||
this->brain = new Brain();
|
||||
}
|
||||
|
||||
Dog & Dog::operator=(Dog const & assign) {
|
||||
std::cout << "[Dog]\t\tCreating Dog class (assign)" << std::endl;
|
||||
(void)assign;
|
||||
this->brain = new Brain();
|
||||
return *this;
|
||||
}
|
||||
|
||||
std::string Dog::getIdea(int index) const {
|
||||
return brain->getIdea(index);
|
||||
}
|
||||
|
||||
void Dog::setIdea(int const index, std::string const idea) const {
|
||||
return brain->setIdea(index, idea);
|
||||
}
|
||||
|
||||
Dog* Dog::clone() const {
|
||||
return new Dog(*this);
|
||||
}
|
||||
|
||||
Dog::~Dog() {
|
||||
delete brain;
|
||||
std::cout << "[Dog]\t\tDeleting the class" << std::endl;
|
||||
std::cout << "[Dog]\t\tDeleting Dog class" << std::endl;
|
||||
}
|
||||
|
||||
void Dog::makeSound() const {
|
||||
std::cout << "🐶 | Wouf Wouf" << std::endl;
|
||||
std::cout << "[Dog]\t\t🐶 | Wouf wouf" << std::endl;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue