diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2016-03-01 08:00:55 -0500 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2016-03-01 08:00:55 -0500 |
commit | 97c701f329bf3da154c23b0529f194d4d8823287 (patch) | |
tree | e003610fa009b82eff3580a6b72407f282b19510 /include/world.h | |
parent | 4df411931dd63f22258be76911e0648c3cdc3936 (diff) | |
parent | 26d71799f37bc325b6db0214268f4e72eb970ee9 (diff) |
Work on merchants and yer mum
Diffstat (limited to 'include/world.h')
-rw-r--r-- | include/world.h | 58 |
1 files changed, 44 insertions, 14 deletions
diff --git a/include/world.h b/include/world.h index 7338097..228defa 100644 --- a/include/world.h +++ b/include/world.h @@ -81,24 +81,54 @@ typedef struct line_t { unsigned char color; /**< Lightness of dirt (brown) */ } line_t; -/* - * Handle all logic that has to do with villages +class World; + +/** + * The village class, used to group structures into villages. */ +class Village { +public: + + /** + * The name of the village. + */ -struct Village{ std::string name; + + /** + * The coordinate of where the village starts. + * + * This is used to check if the player has entered the village's area. + */ + vec2 start; + + /** + * The coordinate of where the village ends. + * + * This is used to check if the player has entered the village's area. + */ + vec2 end; + + /** + * TODO + */ + bool in; + /** + * A vector of all structures that are associated with this village. + */ + std::vector<Structures *> build; - Village(const char *meme){ - name = meme; - end.x = -0xffffffff; - start.x = 0xffffffff; - in = false; - } + + /** + * Creates a village of name `meme` in the world `w`. + */ + + Village(const char *meme, World *w); }; extern Player *player; @@ -134,8 +164,6 @@ protected: */ void singleDetect(Entity *e); - - static void villageLogic(World *world); /** * Empties all entity vectors. @@ -260,6 +288,11 @@ public: std::vector<Particles *> particles; + + + + std::vector<Village * > village; + /** * A vector of all light elements in this world. */ @@ -271,9 +304,6 @@ public: */ std::vector<std::string > sTexLoc; - - std::vector<Village>village; - /** * NULLifies pointers and allocates necessary memory. This should be |