From aa5c31be6ec6a688e8d3a66c770ba99be8e060c9 Mon Sep 17 00:00:00 2001 From: tom Date: Sun, 12 Feb 2017 05:59:12 -0600 Subject: -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 --- inc/creature.hpp | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'inc/creature.hpp') 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 n){N = n;}; + void giveN(std::list 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 N; + SDL_Rect wTarget; + Entity *target; + std::list 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; -- cgit v1.2.3