From 159285c5aa24611ceee7e3847a87bf9ea5f7fb7a Mon Sep 17 00:00:00 2001 From: Lloyd Bryant Date: Fri, 18 Jul 2008 00:48:14 +0000 Subject: Import of client tree --- src/player.h | 43 +++++++++++++++---------------------------- 1 file changed, 15 insertions(+), 28 deletions(-) (limited to 'src/player.h') diff --git a/src/player.h b/src/player.h index f43a6039..fdca64e8 100644 --- a/src/player.h +++ b/src/player.h @@ -18,30 +18,18 @@ * along with The Mana World; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * $Id$ + * $Id: player.h 4237 2008-05-14 18:57:32Z b_lindeijer $ */ #ifndef _TMW_PLAYER_H #define _TMW_PLAYER_H #include "being.h" +#include "text.h" class Graphics; class Map; -class Player; - -class PlayerNameDrawStrategy -{ -public: - virtual ~PlayerNameDrawStrategy(void) {} - - /** - * Draw the player's name - */ - virtual void draw(Player *p, Graphics *graphics, int px, int py) = 0; -}; - /** * A player being. Players have their name drawn beneath them. This class also * implements player-specific loading of base sprite, hair sprite and equipment @@ -52,15 +40,20 @@ class Player : public Being public: Player(int id, int job, Map *map); + ~Player(); + + /** + * Set up mName to be the character's name + */ + virtual void + setName(const std::string &name); + virtual void logic(); virtual Type getType() const; - virtual void - drawName(Graphics *graphics, int offsetX, int offsetY); - virtual void setGender(int gender); @@ -83,19 +76,13 @@ class Player : public Being setSprite(int slot, int id, std::string color = ""); /** - * Sets the strategy responsible for drawing the player's name - * - * \param draw_strategy A strategy describing how the player's name - * should be drawn, or NULL for default + * Flash the player's name */ - virtual void - setNameDrawStrategy(PlayerNameDrawStrategy *draw_strategy); - - virtual PlayerNameDrawStrategy * - getNameDrawStrategy(void) const { return mDrawStrategy; } - + void flash(int time); + protected: + void updateCoords(); private: - PlayerNameDrawStrategy *mDrawStrategy; + FlashText *mName; }; #endif -- cgit v1.2.3-60-g2f50