Bug 508: Make PlayerStatus::reset reset displayed_coins.
[supertux.git] / src / supertux / player_status.hpp
index f8ba723..2ad2836 100644 (file)
@@ -23,8 +23,7 @@
 #include "util/reader_fwd.hpp"
 #include "util/writer_fwd.hpp"
 #include "video/color.hpp"
-
-class Surface;
+#include "video/surface_ptr.hpp"
 
 static const float BORDER_X = 10;
 static const float BORDER_Y = 10;
@@ -35,7 +34,7 @@ enum BonusType {
 class DrawingContext;
 
 /**
- * This class memorizes player status between different game sessions (for
+ * This class keeps player status between different game sessions (for
  * example when switching maps in the worldmap)
  */
 class PlayerStatus
@@ -47,28 +46,27 @@ public:
   void reset();
   void add_coins(int count, bool play_sound = true);
 
-  void write(lisp::Writer& writer);
+  void write(Writer& writer);
   void read(const Reader& lisp);
 
   void draw(DrawingContext& context);
 
+public:
   int  coins;
   BonusType bonus;
   int max_fire_bullets; /**< maximum number of fire bullets in play */
   int max_ice_bullets; /**< maximum number of ice bullets in play */
 
-  void operator= (const PlayerStatus& other);
-
 private:
-  // don't use this
-  PlayerStatus(const PlayerStatus& other);
+  int displayed_coins;
+  int displayed_coins_frame;
+  SurfacePtr coin_surface;
 
-  std::auto_ptr<Surface> coin_surface;
+private:
+  PlayerStatus(const PlayerStatus&);
+  PlayerStatus& operator=(const PlayerStatus&);
 };
 
-// global player state
-extern PlayerStatus* player_status;
-
 #endif
 
 /* EOF */