fix bug 215 (unpausing doesn't always work)
[supertux.git] / src / player_status.hpp
index 4ad7a68..85ac059 100644 (file)
@@ -1,7 +1,8 @@
 //  $Id$
 //
-//  SuperTux -  A Jump'n Run
+//  SuperTux
 //  Copyright (C) 2003 Tobias Glaesser <tobi.web@gmx.de>
+//  Copyright (C) 2006 Matthias Braun <matze@braunis.de>
 //
 //  This program is free software; you can redistribute it and/or
 //  modify it under the terms of the GNU General Public License
 #ifndef SUPERTUX_PLAYERSTATUS_H
 #define SUPERTUX_PLAYERSTATUS_H
 
-#include "lisp/lisp.hpp"
-#include "timer.hpp"
+#include <memory>
 #include "serializable.hpp"
 
+namespace lisp{ class Writer; }
+namespace lisp{ class Lisp; }
+class Surface;
+
+static const float BORDER_X = 10;
+static const float BORDER_Y = 10;
+
 enum BonusType {
   NO_BONUS, GROWUP_BONUS, FIRE_BONUS, ICE_BONUS
 };
 class DrawingContext;
 
-/** 
+/**
  * This class memorizes player status between different game sessions (for
  * example when switching maps in the worldmap)
  */
@@ -36,9 +43,9 @@ class PlayerStatus : public Serializable
 {
 public:
   PlayerStatus();
-  void reset();     
-  void incLives();
-  void incCoins();
+  ~PlayerStatus();
+  void reset();
+  void add_coins(int count, bool play_sound = true);
 
   void write(lisp::Writer& writer);
   void read(const lisp::Lisp& lisp);
@@ -46,14 +53,23 @@ public:
   void draw(DrawingContext& context);
 
   int  coins;
-  int  lives;
   BonusType bonus;
+  int max_fire_bullets; /**< maximum number of fire bullets in play */
+  int max_ice_bullets; /**< maximum number of ice bullets in play */
 
   int score_multiplier;
   int max_score_multiplier;
+
+  void operator= (const PlayerStatus& other);
+
+private:
+  // don't use this
+  PlayerStatus(const PlayerStatus& other);
+
+  std::auto_ptr<Surface> coin_surface;
 };
 
 // global player state
-extern PlayerStatus player_status;
+extern PlayerStatus* player_status;
 
 #endif