diff options
author | tom <tombarrett@siu.edu> | 2017-01-14 11:56:33 -0600 |
---|---|---|
committer | tom <tombarrett@siu.edu> | 2017-01-14 11:56:33 -0600 |
commit | f2f0867edd0d9624a77e4e5db39825b8ea1a55d0 (patch) | |
tree | 1ead1fa412bd7c2e791310c7cb7bbe84c79696a4 /inc/creature.hpp | |
parent | b97a54b8acd113e99871fdb0f683e27e0912bf42 (diff) |
completly remove location structure and replaced it with sdl_rect
Diffstat (limited to 'inc/creature.hpp')
-rw-r--r-- | inc/creature.hpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/inc/creature.hpp b/inc/creature.hpp index 8515bc0..f51d083 100644 --- a/inc/creature.hpp +++ b/inc/creature.hpp @@ -4,23 +4,21 @@ #include <SDL2/SDL.h> #include <list> -#include "location.hpp" #include "entity.hpp" #include "constants.hpp" class Creature: public Entity { public: - Creature(Window m, int size); + Creature(Window m, SDL_Rect R); void Behavior(); void Action(); void Priority(); void setTarget(); - void Move(Location l); + void Move(SDL_Rect R); 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));}; + double Distance(SDL_Rect A, SDL_Rect 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;}; @@ -28,14 +26,15 @@ class Creature: public Entity private: bool hasTarget; bool wander; - Location wTarget; + SDL_Rect wTarget; + int health; - int reach = CREATURE_REACH; + int reach; int maxHealth; bool hungry; - int speed = CREATURE_SPEED; + int speed; bool able; - int bestSense = CREATURE_BEST_SENSE; + int bestSense; list<Entity*> N; Entity *target; |