From f2f0867edd0d9624a77e4e5db39825b8ea1a55d0 Mon Sep 17 00:00:00 2001 From: tom Date: Sat, 14 Jan 2017 11:56:33 -0600 Subject: completly remove location structure and replaced it with sdl_rect --- inc/creature.hpp | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'inc/creature.hpp') 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 #include -#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 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 N; Entity *target; -- cgit v1.2.3