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/common.h | 19 ------------------- include/world.h | 58 ++++++++++++++++++++++++++++++++++++++++++-------------- 2 files changed, 44 insertions(+), 33 deletions(-) (limited to 'include') diff --git a/include/common.h b/include/common.h index ff8d361..71335f2 100644 --- a/include/common.h +++ b/include/common.h @@ -185,23 +185,6 @@ extern unsigned int loops; extern GLuint shaderProgram; -/** - * This class contains a string for identification and a value. It can be used to - * save certain events for and decisions so that they can be recalled later. - */ - -class Condition { -private: - char *id; - void *value; -public: - Condition(const char *_id,void *val); - ~Condition(); - - bool sameID(const char *s); - void *getValue(void); -}; - /** * Prints a formatted debug message to the console, along with the callee's file and line * number. @@ -244,6 +227,4 @@ int strCreateFunc(const char *equ); template size_t arrAmt(N (&)[s]){return s;} -extern void *NULLPTR; - #endif // COMMON_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