summaryrefslogtreecommitdiff
path: root/inc/creature.hpp
blob: 875b4984ed5462836525280f7bf3cdc7e0b90833 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#ifndef creature_h
#define creature_h

#include "entity.hpp"
#include "resource.hpp"
#include "location.hpp"

class Creature: public Entity
{
  public:
    Creature(Window m, std::string s);
    int Behavior();
    bool Action();
    void Priority();
    Location getLocation();
    void giveR(vector<Resource*> n){nR=n;};
    void giveC(vector<Creature*> n){nC=n;};
    
    double Distance(Location A, Location B){return sqrt(pow(A.x-B.x,2)+pow(A.y-B.y,2));};
    int getHealth(){return health;};
    bool doesItHaveTarget(){return hasTarget;};
    int getBestSense(){return bestSense;};

  private:
    int xTarget; 
    int yTarget; 

    bool hasTarget;
    bool wandering;

    int health; 
    int maxHealth;
    int hunger; 
    int speed = 2;
    bool able;     
    int bestSense = 100; 

    vector<Resource*> nR; //vector containing resources near the creature
    vector<Creature*> nC; //vector containing creatures near the creature
    int n; 
};

#endif