From 2cc21176467d4501adb7bfb9ee03eb9a2a7d14f2 Mon Sep 17 00:00:00 2001 From: majortom6 Date: Sun, 19 Feb 2017 08:06:37 -0600 Subject: -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 --- inc/creature.hpp | 76 +++++++++++++++++++++++++++----------------------------- 1 file changed, 37 insertions(+), 39 deletions(-) (limited to 'inc/creature.hpp') 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 -#include #include -#include #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 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 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 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 nearMe; + DNA myDNA; + DNA childsDNA; + + int health; + int amountAte; + int pregnancyTime; + int age; + + bool hungry; + bool pregnancyReady; + bool able; + bool hasTarget; + bool wander; }; #endif -- cgit v1.2.3