d04 ex02 change pour pouvoir effectuer le test de erlazo

This commit is contained in:
hugogogo
2022-03-12 16:21:56 +01:00
parent 329e38b84b
commit 96e78e34a1
11 changed files with 138 additions and 16 deletions

View File

@@ -2,23 +2,24 @@
# define ANIMAL_HPP
# include "color.h"
#include <iostream>
#include <string>
# include <iostream>
# include <string>
# include "Brain.hpp"
class Animal {
public:
Animal();
Animal( Animal const & src );
virtual ~Animal( void );
Animal & operator=( Animal const & rhs );
virtual Animal & operator=( Animal const & rhs );
virtual void makeSound() const = 0;
std::string getType() const;
protected:
virtual Brain * getBrain() const = 0;
protected:
std::string type;
};

View File

@@ -15,14 +15,17 @@ public:
Cat();
Cat( Brain *brain );
// Cat( Brain *brain = new Brain() );
Cat( std::string ideas );
Cat( Cat const & src );
~Cat();
Cat & operator=( Cat const & rhs );
Cat & operator=( Animal const & rhs );
void makeSound() const;
void printBrain() const;
void printBrain(int pos) const;
Brain * getBrain() const;
private:

View File

@@ -17,8 +17,10 @@ public:
Dog( Dog const & src );
~Dog();
Dog & operator=( Dog const & rhs );
Dog & operator=( Animal const & rhs );
void makeSound() const;
Brain * getBrain() const;
private: