From 8d9ad3eb74bc0dfc647abf03b7b99ed16f2a9115 Mon Sep 17 00:00:00 2001 From: tom Date: Mon, 2 May 2016 21:24:02 -0500 Subject: implementing better modularity, came into bad bug. All creatures seem to have same near vector. --- inc/creature.hpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'inc/creature.hpp') diff --git a/inc/creature.hpp b/inc/creature.hpp index ffff888..082e8d9 100644 --- a/inc/creature.hpp +++ b/inc/creature.hpp @@ -9,12 +9,11 @@ class Creature: public Entity { public: Creature(Window m, std::string s); - int Behavior(); - bool Action(); + void Behavior(); + void Action(); void Priority(); - void giveR(vector n){nR=n;}; - void giveC(vector n){nC=n;}; - + void giveN(vector n){N = n;}; + Location getLocation(){return L;}; double Distance(Location A, Location B){return sqrt(pow(A.x-B.x,2)+pow(A.y-B.y,2));}; int getHealth(){return health;}; @@ -22,9 +21,6 @@ class Creature: public Entity int getBestSense(){return bestSense;}; private: - int xTarget; - int yTarget; - bool hasTarget; bool wandering; @@ -34,10 +30,9 @@ class Creature: public Entity int speed = 1; bool able; int bestSense = 100; - - vector nR; //vector containing resources near the creature - vector nC; //vector containing creatures near the creature + vector N; + Entity *target; int n; }; -- cgit v1.2.3