diff options
author | tom <tombarrett@siu.edu> | 2017-02-12 05:59:12 -0600 |
---|---|---|
committer | tom <tombarrett@siu.edu> | 2017-02-12 05:59:12 -0600 |
commit | aa5c31be6ec6a688e8d3a66c770ba99be8e060c9 (patch) | |
tree | 702a7154031cb9c96d0e7fd495868418433bb842 /inc/creature.hpp | |
parent | 60b53e09cca0bdb4cddff76457e990ee33c42b2f (diff) |
-minor constant changes
-implemented dna structure, which carries the creatures attributes suchas speed and reach
-currently a child inherits 100% the same dna as the mother
-removed sing namespace std
Diffstat (limited to 'inc/creature.hpp')
-rw-r--r-- | inc/creature.hpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/inc/creature.hpp b/inc/creature.hpp index 1676be0..95b1329 100644 --- a/inc/creature.hpp +++ b/inc/creature.hpp @@ -7,11 +7,12 @@ #include "entity.hpp" #include "constants.hpp" #include "functions.hpp" +#include "dna.hpp" class Creature: public Entity { public: - Creature(Window m, SDL_Rect R); + Creature(Window M, SDL_Rect R, Dna D); void Behavior(); void Action(); void Priority(); @@ -19,31 +20,25 @@ class Creature: public Entity void checkTarget(); void Move(SDL_Rect R); void impregnate(); - void giveN(list<Entity*> n){N = n;}; + void giveN(std::list<Entity*> n){N = n;}; + Dna getDNA(){return mine;}; int getHealth(){return health;}; - int getBestSense(){return bestSense;}; + int getBestSense(){return mine.bestSense;}; bool getGender(){return gender;}; bool getPregnancyReady(){return pregnancyReady;}; void hadPregnancy(){pregnate = pregnancyReady = false;}; private: - SDL_Rect wTarget; - Entity *target; - list<Entity*> N; + SDL_Rect wTarget; + Entity *target; + std::list<Entity*> N; + Dna mine; int health; - int reach; - int maxHealth; - int speed; - int bestSense; - int bite; int amountAte; - int amountToGrow; int pregnancyTime; - int expectedPregnancyTime; int age; - int expectedAge; bool hungry; bool pregnancyReady; |