diff options
Diffstat (limited to 'src/player.h')
-rw-r--r-- | src/player.h | 47 |
1 files changed, 14 insertions, 33 deletions
diff --git a/src/player.h b/src/player.h index fe24ceed..6347b0a6 100644 --- a/src/player.h +++ b/src/player.h @@ -25,23 +25,11 @@ #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,6 +40,14 @@ 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(); @@ -59,9 +55,6 @@ class Player : public Being getType() const; virtual void - drawName(Graphics *graphics, int offsetX, int offsetY); - - virtual void setGender(int gender); /** @@ -83,27 +76,15 @@ 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); - /** - * Triggers a visual/audio effect, such as `level up' - * - * \param effect_id ID of the effect to trigger - */ - virtual void - triggerEffect(int effectId) { internalTriggerEffect(effectId, true, true); } + protected: + void updateCoords(); private: - PlayerNameDrawStrategy *mDrawStrategy; + FlashText *mName; }; #endif |