summaryrefslogtreecommitdiff
path: root/inc/creature.hpp
diff options
context:
space:
mode:
authortom <tombarrett@siu.edu>2017-02-12 08:42:55 -0600
committertom <tombarrett@siu.edu>2017-02-12 08:42:55 -0600
commit60bc5dcb19a983e8ae335ba89f860c59473303fb (patch)
tree6f232f9db0d71678ce593a765b88f4934976ed83 /inc/creature.hpp
parent1da46794f74ebd8f445fcd70cbe0420eadb648e4 (diff)
-added DNA combining, currently it just takes the average of the mother and father
-there maybe a random segfault, further investigation is needed
Diffstat (limited to 'inc/creature.hpp')
-rw-r--r--inc/creature.hpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/inc/creature.hpp b/inc/creature.hpp
index c3ed2d8..56954fe 100644
--- a/inc/creature.hpp
+++ b/inc/creature.hpp
@@ -20,10 +20,11 @@ class Creature: public Entity
void setTarget();
void checkTarget();
void Move(SDL_Rect R);
- void impregnate();
+ void impregnate(Dna D);
void giveN(std::vector<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;};
@@ -31,10 +32,11 @@ class Creature: public Entity
void hadPregnancy(){pregnate = pregnancyReady = false;};
private:
- SDL_Rect wTarget;
- Entity *target;
- std::vector<Entity*>N;
- Dna mine;
+ SDL_Rect wTarget;
+ Entity *target;
+ std::vector<Entity*> N;
+ Dna mine;
+ Dna childs;
int health;
int amountAte;