From 2327c5a7c3b054e52b69286da906f8e5c4432d1c Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Sun, 9 Oct 2005 16:27:05 +0000 Subject: Fixed player names overlapping other players and more cleanups. --- src/being.h | 62 +++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 34 insertions(+), 28 deletions(-) (limited to 'src/being.h') diff --git a/src/being.h b/src/being.h index d5ec7fab..67c8c6b6 100644 --- a/src/being.h +++ b/src/being.h @@ -88,7 +88,6 @@ class Being : public Sprite Uint8 mFrame; Sint32 speech_color; Uint16 walk_time; - Uint16 speed; Uint8 emotion; /**< Currently showing emotion */ Uint8 emotion_time; /**< Time until emotion disappears */ @@ -152,14 +151,14 @@ class Being : public Sprite void setHairColor(Uint16 color); /** - * Sets the hair style for this being. + * Gets the hair color for this being. */ - void setHairStyle(Uint16 style); + Uint16 getHairColor(); /** - * Gets the hair color for this being. + * Sets the hair style for this being. */ - Uint16 getHairColor(); + void setHairStyle(Uint16 style); /** * Gets the hair style for this being. @@ -169,37 +168,31 @@ class Being : public Sprite /** * Makes this being take the next step of his path. */ - void nextStep(); + void + nextStep(); /** * Performs being logic. */ - void logic(); + void + logic(); /** * Draws the speech text above the being. */ - void drawSpeech(Graphics *graphics, Sint32 offsetX, Sint32 offsetY); + void + drawSpeech(Graphics *graphics, Sint32 offsetX, Sint32 offsetY); /** * Returns the type of the being. */ Type getType() const; - // ACCES METHODS - /** * Gets the weapon picture id. */ Uint16 getWeapon() const { return mWeapon; } - /** - * Gets the sprite id. - */ - Uint32 getId() const { return mId; } - - // MODIFICATION METHODS - /** * Sets the weapon picture id. * @@ -213,7 +206,26 @@ class Being : public Sprite * * @param weapon the weapon id */ - void setWeaponById(Uint16 weapon); + void + setWeaponById(Uint16 weapon); + + /** + * Gets the walk speed. + */ + Uint16 + getWalkSpeed() const { return mWalkSpeed; } + + /** + * Sets the walk speed. + */ + void + setWalkSpeed(Uint16 speed) { mWalkSpeed = speed; } + + /** + * Gets the sprite id. + */ + Uint32 + getId() const { return mId; } /** * Sets the sprite id. @@ -226,8 +238,6 @@ class Being : public Sprite */ void setMap(Map *map); - // SPRITE METHODS - /** * Draws this being to the given graphics context. * @@ -269,8 +279,9 @@ class Being : public Sprite void setPath(std::list path); + Uint32 mId; /**< Unique sprite id */ Uint16 mWeapon; /**< Weapon picture id */ - Uint32 mId; /**< Unique id */ + Uint16 mWalkSpeed; /**< Walking speed */ Map *mMap; /**< Map on which this being resides */ std::string mName; /**< Name of character */ Sprites::iterator mSpriteIterator; @@ -315,14 +326,9 @@ createBeing(Uint32 id, Uint16 job, Map *map); void remove_node(Being *being); -/** - * Sort beings in vertical order - */ -void -sort(); - extern Being *player_node; -extern std::list beings; +typedef std::list Beings; +extern Beings beings; #endif -- cgit v1.2.3-70-g09d2