diff options
author | tom <tom@ground-control> | 2016-05-02 21:24:02 -0500 |
---|---|---|
committer | tom <tom@ground-control> | 2016-05-02 21:24:02 -0500 |
commit | 8d9ad3eb74bc0dfc647abf03b7b99ed16f2a9115 (patch) | |
tree | eb16f853c280ed200953fbc7a500193a69ef8892 /inc/creature.hpp | |
parent | 0346965968fb5da1a52ed8f896a922c63ce180f6 (diff) |
implementing better modularity, came into bad bug. All creatures seem to have same near vector.
Diffstat (limited to 'inc/creature.hpp')
-rw-r--r-- | inc/creature.hpp | 17 |
1 files changed, 6 insertions, 11 deletions
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<Resource*> n){nR=n;}; - void giveC(vector<Creature*> n){nC=n;}; - + void giveN(vector<Entity*> 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<Resource*> nR; //vector containing resources near the creature - vector<Creature*> nC; //vector containing creatures near the creature + vector<Entity*> N; + Entity *target; int n; }; |