diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/creature.hpp | 12 | ||||
-rw-r--r-- | inc/entity.hpp | 4 | ||||
-rw-r--r-- | inc/list.hpp | 4 | ||||
-rw-r--r-- | inc/location.hpp | 14 | ||||
-rw-r--r-- | inc/resource.hpp | 2 |
5 files changed, 19 insertions, 17 deletions
diff --git a/inc/creature.hpp b/inc/creature.hpp index f72dfbc..9bb73ee 100644 --- a/inc/creature.hpp +++ b/inc/creature.hpp @@ -10,14 +10,16 @@ class Creature: public Entity Creature(Window m, std::string s); void Behavior(); void Action(); + void Priority(); Location getLocation(); + void giveKnown(std::vector<Location> Z){location = Z;}; private: - int xT; - int yT; - int hp; - int hu; - Location K[3]; + int xTarget; //x-coordinate of creature's target position + int yTarget; //y-coordinate of creature's target position + int health; //health of a creature (0-100) + int hunger; //value associated with a creatures want to find food (0-100) + std::vector<Location> location; //vector containing objects near the creature }; #endif diff --git a/inc/entity.hpp b/inc/entity.hpp index 5ed2e74..079da9b 100644 --- a/inc/entity.hpp +++ b/inc/entity.hpp @@ -10,8 +10,8 @@ class Entity SDL_Texture* loadTexture(std::string path, Window main); protected: - int x, y; - int height, width; + int xPosition, yPosition; //Coordinates of entity on window + int height, width; //Dimensions of image on window int degrees = 0; SDL_Texture* texture; SDL_Renderer* renderer; diff --git a/inc/list.hpp b/inc/list.hpp index 203ad7f..dc5c412 100644 --- a/inc/list.hpp +++ b/inc/list.hpp @@ -12,9 +12,11 @@ class List List(Window m); void Behavior(); void Place(); + double Distance(Location A, Location B); private: - //Window main; + //vectors containing objects of each type + Window * main;//will be needed for adding R's and C's after constructor. std::vector<Resource> R; std::vector<Creature> C; std::vector<Location> L; diff --git a/inc/location.hpp b/inc/location.hpp index 2042734..8bd512c 100644 --- a/inc/location.hpp +++ b/inc/location.hpp @@ -4,14 +4,12 @@ class Location { public: - Location(){x=y=t=0;}; - Location(int x, int y, int z){}; - int getType(){return t;}; - - private: - int x; - int y; - int t; + Location(){x=y=type=0;}; //is this line needed? + Location(int x1, int y1, int t1){x=x1;y=y1;type=t1;}; + + int x; //x-coordinate of entity + int y; //y-coordinate of entity + int type; //value associated with type of entity at location. 1: Creature, 2: Resource }; #endif diff --git a/inc/resource.hpp b/inc/resource.hpp index 2738f44..383e9ef 100644 --- a/inc/resource.hpp +++ b/inc/resource.hpp @@ -11,7 +11,7 @@ class Resource: public Entity Location getLocation(); private: - int amount; + int amount; //value associated with the amount of whatever (food, etc) left in the resource }; #endif |