summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/creature.hpp6
-rw-r--r--inc/entity.hpp18
-rw-r--r--inc/resource.hpp4
3 files changed, 15 insertions, 13 deletions
diff --git a/inc/creature.hpp b/inc/creature.hpp
index 636d960..bc23652 100644
--- a/inc/creature.hpp
+++ b/inc/creature.hpp
@@ -8,14 +8,14 @@
class Creature: public Entity
{
public:
- Creature(Window m, std::string s);
+ Creature(Window m, int size);
void Behavior();
void Action();
void Priority();
void setTarget();
void Move(Location l);
+
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;};
@@ -31,7 +31,7 @@ class Creature: public Entity
bool hungry;
int speed = 1;
bool able;
- int bestSense = 100;
+ int bestSense = 100;
list<Entity*> N;
Entity *target;
diff --git a/inc/entity.hpp b/inc/entity.hpp
index 540e7b9..62c14d4 100644
--- a/inc/entity.hpp
+++ b/inc/entity.hpp
@@ -7,19 +7,21 @@
class Entity
{
public:
+ void Init(Window m);
+ void Init(Window m, Location z);
void Place();
- SDL_Texture* loadTexture(std::string path, Window main);
- Location getLocation(){return L;};
+
int getType(){return type;};
- virtual void eat(void) {};
- virtual int getAmount(void) {};
+ Location getLocation(){return L;};
+ SDL_Rect getRect(){return rect;};
+
+ virtual void eat(void){};
+ virtual int getAmount(void){};
protected:
- Location L;
- int height, width; //Dimensions of image on window
- int degrees = 0;
int type = 0;
- SDL_Texture* texture;
+ SDL_Rect rect;
+ Location L;
SDL_Renderer* renderer;
};
diff --git a/inc/resource.hpp b/inc/resource.hpp
index 968c208..5f70585 100644
--- a/inc/resource.hpp
+++ b/inc/resource.hpp
@@ -7,8 +7,8 @@
class Resource: public Entity
{
public:
- Resource(Window m, std::string s);
- Resource(Window m, std::string s, Location z);
+ Resource(Window m, int size);
+ Resource(Window m, int size, Location z);
void eat();
Location getLocation(){return L;};