blob: 7da82e58ec08661f81621013a2da8217bc02b5c9 (
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
|
#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);
void Behavior();
void Action();
void Priority();
void giveN(list<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;};
bool doesItHaveTarget(){return hasTarget;};
int getBestSense(){return bestSense;};
private:
bool hasTarget;
int health;
int maxHealth;
int hunger;
int speed = 1;
bool able;
int bestSense = 100;
list<Entity*> N;
Entity *target;
};
#endif
|