summaryrefslogtreecommitdiff
path: root/src/player.h
diff options
context:
space:
mode:
authorBjørn Lindeijer <bjorn@lindeijer.nl>2008-05-14 18:57:32 +0000
committerBjørn Lindeijer <bjorn@lindeijer.nl>2008-05-14 18:57:32 +0000
commit2d648c5dc29a1ceae154194c23c799c7076894b4 (patch)
treef6c31a30260b80713257be211b139263b3291098 /src/player.h
parent41906acb990895831e3b2c39102f41c9b580ae10 (diff)
downloadmana-2d648c5dc29a1ceae154194c23c799c7076894b4.tar.gz
mana-2d648c5dc29a1ceae154194c23c799c7076894b4.tar.bz2
mana-2d648c5dc29a1ceae154194c23c799c7076894b4.tar.xz
mana-2d648c5dc29a1ceae154194c23c799c7076894b4.zip
Added ability to define friends, players you want to ignore or disregard and
configure whether trading is allowed. Based on new popup code, configuration improvements to store hierarchical data and a table model.
Diffstat (limited to 'src/player.h')
-rw-r--r--src/player.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/player.h b/src/player.h
index e9a30da0..f43a6039 100644
--- a/src/player.h
+++ b/src/player.h
@@ -29,6 +29,19 @@
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
@@ -68,6 +81,21 @@ class Player : public Being
*/
virtual void
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
+ */
+ virtual void
+ setNameDrawStrategy(PlayerNameDrawStrategy *draw_strategy);
+
+ virtual PlayerNameDrawStrategy *
+ getNameDrawStrategy(void) const { return mDrawStrategy; }
+
+ private:
+ PlayerNameDrawStrategy *mDrawStrategy;
};
#endif