diff options
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 |