diff options
Diffstat (limited to 'inc/creature.hpp')
-rw-r--r-- | inc/creature.hpp | 76 |
1 files changed, 37 insertions, 39 deletions
diff --git a/inc/creature.hpp b/inc/creature.hpp index 1bc6f49..99226b3 100644 --- a/inc/creature.hpp +++ b/inc/creature.hpp @@ -2,53 +2,51 @@ #define creature_h #include <SDL2/SDL.h> -#include <vector> #include <list> -#include <algorithm> #include "entity.hpp" -#include "constants.hpp" #include "functions.hpp" #include "dna.hpp" class Creature: public Entity { - public: - Creature(Location t, Dna D); - void Behavior(); - void Action(); - void Priority(); - void setTarget(); - void checkTarget(); - void moveTowards(Location t); - void impregnate(Dna D); - void giveN(std::list<Entity*> n){N = n;}; - - Dna getDNA(){return mine;}; - Dna getChildDNA(){return childs;}; - int getHealth(){return health;}; - int getBestSense(){return mine.bestSense;}; - bool getGender(){return gender;}; - bool getPregnancyReady(){return pregnancyReady;}; - void hadPregnancy(){pregnate = pregnancyReady = false;}; - - private: - Location wTarget; - Entity *target; - std::list<Entity*> N; - Dna mine; - Dna childs; - - int health; - int amountAte; - int pregnancyTime; - int age; - - bool hungry; - bool pregnancyReady; - bool able; - bool hasTarget; - bool wander; + public: + Creature(Rectangle t, DNA D); + + void Behavior(); + void Action(); + void Priority(); + void setTarget(); + void checkTarget(); + void moveTowards(Rectangle t); + void impregnate(DNA D); + void giveNearMe(std::list<Entity*> n){nearMe = n;}; + + DNA getDNA(){return myDNA;}; + DNA getChildsDNA(){return childsDNA;}; + int getHealth(){return health;}; + int getBestSense(){return myDNA.bestSense;}; + bool getGender(){return gender;}; + bool getPregnancyReady(){return pregnancyReady;}; + void hadPregnancy(){pregnate = pregnancyReady = false;}; + + private: + Rectangle wTarget; + Entity* target; + std::list<Entity*> nearMe; + DNA myDNA; + DNA childsDNA; + + int health; + int amountAte; + int pregnancyTime; + int age; + + bool hungry; + bool pregnancyReady; + bool able; + bool hasTarget; + bool wander; }; #endif |