summaryrefslogtreecommitdiff
path: root/src/being.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-13 01:16:52 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-03-13 01:16:52 +0000
commitab9debf3fa91f3b36c6739f4affbdc187e78113d (patch)
tree4e22c94c0c3fd70c7741e98a7d81d0150ff57fba /src/being.h
parentd0c5ab3fe88e1248f755a764248037960f7bed35 (diff)
downloadmana-ab9debf3fa91f3b36c6739f4affbdc187e78113d.tar.gz
mana-ab9debf3fa91f3b36c6739f4affbdc187e78113d.tar.bz2
mana-ab9debf3fa91f3b36c6739f4affbdc187e78113d.tar.xz
mana-ab9debf3fa91f3b36c6739f4affbdc187e78113d.zip
* Moved Being public char *speech to private std::string speech
* Moved Being public PATH_NODE *path to private std::list<PATH_NODE> path * Fixed warping issue which corrupted player (which also applies to respawning) * Got rid of sound error in Setup window
Diffstat (limited to 'src/being.h')
-rw-r--r--src/being.h44
1 files changed, 34 insertions, 10 deletions
diff --git a/src/being.h b/src/being.h
index 657a0658..cc357ff3 100644
--- a/src/being.h
+++ b/src/being.h
@@ -25,6 +25,8 @@
#define _TMW_BEING_H
#include <list>
+#include <string>
+#include "graphics.h"
struct PATH_NODE {
/**
@@ -33,12 +35,13 @@ struct PATH_NODE {
PATH_NODE(unsigned short x, unsigned short y);
unsigned short x, y;
- PATH_NODE *next;
};
class Being {
private:
- PATH_NODE *path;
+ std::list<PATH_NODE> path;
+ std::string speech;
+ unsigned char speech_time;
public:
unsigned int id;
@@ -49,8 +52,6 @@ class Being {
unsigned char type;
unsigned char action;
unsigned char frame;
- char *speech;
- unsigned char speech_time;
int speech_color;
unsigned short walk_time;
unsigned short speed;
@@ -78,21 +79,44 @@ class Being {
/**
* Sets the new path for this being.
*/
- void setPath(PATH_NODE *path);
+ void setPath(std::list<PATH_NODE> path);
+
+ /**
+ * Puts a "speech balloon" above this being for the specified amount
+ * of time.
+ *
+ * @param text The text that should appear.
+ * @param time The amount of time the text should stay in milliseconds.
+ */
+ void setSpeech(const std::string &text, int time);
+
+ /**
+ * Sets the hair color for this being.
+ */
+ void setHairColor(int color);
/**
- * Returns wether this being has a path to follow.
+ * Sets the hair style for this being.
*/
- bool hasPath();
+ void setHairStyle(int style);
/**
* Makes this being take the next step of his path.
*/
void nextStep();
-};
-/** Removes all beings from the list */
-void empty();
+ /**
+ * Draws the speech text above the being.
+ */
+ void drawSpeech(Graphics *graphics);
+
+ /**
+ * Tick gives the being a sense of time. It should be called either a
+ * specific amount of times per second, or be modified to be passed a
+ * number that tells it the time since the last call.
+ */
+ void tick();
+};
/** Add a Being to the list */
void add_node(Being *being);