summaryrefslogtreecommitdiff
path: root/src/being.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-21 13:31:36 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2005-01-21 13:31:36 +0000
commite0a956b4045ca09631d9a9a616ca675f2c1f4a78 (patch)
treeb98a0bf6970c76a226436effed21f44611015e4f /src/being.h
parentad12a9189f33e65de827219eb573a6e63c7862c9 (diff)
downloadmana-e0a956b4045ca09631d9a9a616ca675f2c1f4a78.tar.gz
mana-e0a956b4045ca09631d9a9a616ca675f2c1f4a78.tar.bz2
mana-e0a956b4045ca09631d9a9a616ca675f2c1f4a78.tar.xz
mana-e0a956b4045ca09631d9a9a616ca675f2c1f4a78.zip
Some refactoring of Being class.
Diffstat (limited to 'src/being.h')
-rw-r--r--src/being.h40
1 files changed, 33 insertions, 7 deletions
diff --git a/src/being.h b/src/being.h
index 072cc9ae..ed6b4e31 100644
--- a/src/being.h
+++ b/src/being.h
@@ -38,6 +38,9 @@ struct PATH_NODE {
};
class Being {
+ private:
+ PATH_NODE *path;
+
public:
unsigned int id;
unsigned short job;
@@ -46,20 +49,46 @@ class Being {
unsigned char type;
unsigned char action;
unsigned char frame;
- PATH_NODE *path;
char *speech;
unsigned char speech_time;
int speech_color;
- unsigned short tick_time;
+ unsigned short walk_time;
unsigned short speed;
unsigned char emotion;
unsigned char emotion_time;
unsigned int text_x, text_y; // temp solution to fix speech position
unsigned short hair_style, hair_color;
unsigned short weapon;
-
+
+ /**
+ * Constructor.
+ */
Being();
- ~Being();
+
+ /**
+ * Destructor.
+ */
+ ~Being();
+
+ /**
+ * Removes all path nodes from this being.
+ */
+ void clearPath();
+
+ /**
+ * Sets the new path for this being.
+ */
+ void setPath(PATH_NODE *path);
+
+ /**
+ * Returns wether this being has a path to follow.
+ */
+ bool hasPath();
+
+ /**
+ * Makes this being take the next step of his path.
+ */
+ void nextStep();
};
/** Removes all beings from the list */
@@ -87,9 +116,6 @@ unsigned int find_monster(unsigned short x, unsigned short y);
/** Sort beings in vertical order */
void sort();
-/** Remove all path nodes from a being */
-void empty_path(Being *being);
-
extern Being *player_node;
extern std::list<Being*> beings;