aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-02-26 07:49:33 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-02-26 07:49:33 -0500
commit26d71799f37bc325b6db0214268f4e72eb970ee9 (patch)
tree41306f63fc17fd176d720df8dfb90dde6bdc5159 /include
parent8f4cada7bf1068a9a3063636f7008cbe52875924 (diff)
village cleanup?
Diffstat (limited to 'include')
-rw-r--r--include/common.h19
-rw-r--r--include/world.h58
2 files changed, 44 insertions, 33 deletions
diff --git a/include/common.h b/include/common.h
index ff8d361..71335f2 100644
--- a/include/common.h
+++ b/include/common.h
@@ -186,23 +186,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<typename N, size_t s>
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<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);
};
/**
@@ -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 *> particles;
+
+
+
+ std::vector<Village * > village;
+
/**
* A vector of all light elements in this world.
*/
@@ -264,9 +297,6 @@ public:
*/
std::vector<std::string > sTexLoc;
-
- std::vector<Village>village;
-
/**
* NULLifies pointers and allocates necessary memory. This should be