diff --git a/includes/loup.hpp b/includes/loup.hpp index debe017..0e6c3fe 100644 --- a/includes/loup.hpp +++ b/includes/loup.hpp @@ -4,14 +4,15 @@ #include "animal.hpp" class Loup: public Animal { + int generationVitesse(void) const noexcept; + public: - Loup(void); + Loup(int); + Loup(int, int, int); ~Loup(void); + // Renvoie vrai bool carnivore(void) const noexcept; - - // Représenté par "2" dans l'univers - short id(void) const noexcept; }; #endif diff --git a/includes/mouton.hpp b/includes/mouton.hpp index 700d873..9511f9c 100644 --- a/includes/mouton.hpp +++ b/includes/mouton.hpp @@ -4,14 +4,14 @@ #include "animal.hpp" class Mouton: public Animal { + int generationVitesse(void) const noexcept; + public: - Mouton(void); - ~Mouton(void); + Mouton(int); + Mouton(int, int, int); + // Renvoie faux bool carnivore(void) const noexcept; - - // Représenté par "1" dans l'univers - short id(void) const noexcept; }; #endif diff --git a/src/loup.cpp b/src/loup.cpp index d5491c6..f4a2fc9 100644 --- a/src/loup.cpp +++ b/src/loup.cpp @@ -1,15 +1,19 @@ #include "../includes/loup.hpp" -Loup::Loup(void): Animal() { - _correspondance[id()] = 'L'; +Loup::Loup(int universID): Animal(universID, 60, 0, Loup::generationVitesse()) { + _correspondance[ID] = 'L'; +} + +Loup::Loup(int universID, int x, int y): Animal(universID, x, y, 60, 0, Loup::generationVitesse()) { + _correspondance[ID] = 'L'; } Loup::~Loup(void) { } +int Loup::generationVitesse(void) const noexcept { + return 0; +} + bool Loup::carnivore(void) const noexcept { return true; } - -short Loup::id(void) const noexcept { - return 2; -} diff --git a/src/mouton.cpp b/src/mouton.cpp index a302cfd..410f323 100644 --- a/src/mouton.cpp +++ b/src/mouton.cpp @@ -1,15 +1,17 @@ #include "../includes/mouton.hpp" -Mouton::Mouton(void): Animal() { - _correspondance[id()] = 'M'; +Mouton::Mouton(int universID): Animal(universID, 50, 0, Mouton::generationVitesse()) { + _correspondance[ID] = 'M'; } -Mouton::~Mouton(void) { } +Mouton::Mouton(int universID, int x, int y): Animal(universID, x, y, 50, 0, Mouton::generationVitesse()) { + _correspondance[ID] = 'M'; +} + +int Mouton::generationVitesse(void) const noexcept { + return 0; +} bool Mouton::carnivore(void) const noexcept { return false; } - -short Mouton::id(void) const noexcept { - return 1; -}