From 26d71799f37bc325b6db0214268f4e72eb970ee9 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Fri, 26 Feb 2016 07:49:33 -0500 Subject: village cleanup? --- include/world.h | 58 +++++++++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 14 deletions(-) (limited to 'include/world.h') diff --git a/include/world.h b/include/world.h index f9e952e..56f1577 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 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); }; /** @@ -132,8 +162,6 @@ protected: */ void singleDetect(Entity *e); - - static void villageLogic(World *world); /** * Empties all entity vectors. @@ -253,6 +281,11 @@ public: std::vector particles; + + + + std::vector village; + /** * A vector of all light elements in this world. */ @@ -264,9 +297,6 @@ public: */ std::vector sTexLoc; - - std::vectorvillage; - /** * NULLifies pointers and allocates necessary memory. This should be -- cgit v1.2.3