From aaf0a73578ecbb8212e0d224d6fff68a229b1f48 Mon Sep 17 00:00:00 2001 From: tom Date: Tue, 5 May 2015 21:01:52 -0500 Subject: fleshed out list, locations of all creatures and resources are now within --- inc/creature.hpp | 9 +++++++-- inc/list.hpp | 3 ++- inc/location.hpp | 17 +++++++++++++++++ inc/main.hpp | 1 + inc/resource.hpp | 5 +++++ inc/window.hpp | 1 + 6 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 inc/location.hpp (limited to 'inc') diff --git a/inc/creature.hpp b/inc/creature.hpp index ab4b328..f72dfbc 100644 --- a/inc/creature.hpp +++ b/inc/creature.hpp @@ -2,17 +2,22 @@ #define creature_h #include "entity.hpp" +#include "location.hpp" class Creature: public Entity { public: Creature(Window m, std::string s); void Behavior(); - void Action(); - + void Action(); + Location getLocation(); + private: int xT; int yT; + int hp; + int hu; + Location K[3]; }; #endif diff --git a/inc/list.hpp b/inc/list.hpp index 240fa95..203ad7f 100644 --- a/inc/list.hpp +++ b/inc/list.hpp @@ -4,6 +4,7 @@ #include "creature.hpp" #include "resource.hpp" #include "window.hpp" +#include "location.hpp" class List { @@ -16,7 +17,7 @@ class List //Window main; std::vector R; std::vector C; - int ** L; + std::vector L; }; #endif diff --git a/inc/location.hpp b/inc/location.hpp new file mode 100644 index 0000000..c4428f5 --- /dev/null +++ b/inc/location.hpp @@ -0,0 +1,17 @@ +#ifndef location_h +#define location_h + +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; +}; + +#endif diff --git a/inc/main.hpp b/inc/main.hpp index 4360cf9..c6f51e3 100644 --- a/inc/main.hpp +++ b/inc/main.hpp @@ -7,5 +7,6 @@ #include "creature.hpp" #include "resource.hpp" #include "list.hpp" +#include "location.hpp" #endif diff --git a/inc/resource.hpp b/inc/resource.hpp index 986a03d..2738f44 100644 --- a/inc/resource.hpp +++ b/inc/resource.hpp @@ -2,11 +2,16 @@ #define resource_h #include "entity.hpp" +#include "location.hpp" class Resource: public Entity { public: Resource(Window m, std::string s); + Location getLocation(); + + private: + int amount; }; #endif diff --git a/inc/window.hpp b/inc/window.hpp index 2f65b04..d3436d8 100644 --- a/inc/window.hpp +++ b/inc/window.hpp @@ -1,6 +1,7 @@ #ifndef window_h #define window_h +//Theres alot here that are probs not used needs cleaning #include #include #include -- cgit v1.2.3