summaryrefslogtreecommitdiff
path: root/inc/creature.hpp
diff options
context:
space:
mode:
authormajortom6 <tombarrett@siu.edu>2017-02-19 08:06:37 -0600
committerTom Barrett <tombarrett@siu.edu>2017-03-07 13:23:41 -0600
commit2cc21176467d4501adb7bfb9ee03eb9a2a7d14f2 (patch)
treee12ceac7024bdc697f1ed4adc1a1ece4a82489fc /inc/creature.hpp
parent74c6854fd8dcbaee736ac0421805ff1e03c4a1e2 (diff)
-removed all references to sdl_rect and location and now everything now uses our own class rectangle
-standardization of tab spaces to 8 is now in effect -refractoring of graphicsobjects.hpp
Diffstat (limited to 'inc/creature.hpp')
-rw-r--r--inc/creature.hpp76
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