fix cr/lfs and remove trailing whitespaces...
[supertux.git] / src / worldmap / sprite_change.hpp
index 354e32c..4754e27 100644 (file)
@@ -1,8 +1,7 @@
 //  $Id$
 //
 //  SuperTux
-//  Copyright (C) 2004 Ingo Ruhnke <grumbel@gmx.de>
-//  Copyright (C) 2006 Christoph Sommer <christoph.sommer@2006.expires.deltadevelopment.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
@@ -22,6 +21,7 @@
 
 #include <string>
 #include <memory>
+#include <list>
 #include "game_object.hpp"
 #include "lisp/lisp.hpp"
 #include "math/vector.hpp"
@@ -51,16 +51,36 @@ public:
    * another SpriteChange object.
    */
   std::string stay_action;
+
   /**
-   * should the stayaction be displayed
+   * name of a group in which only one SpriteChange will ever have its stay_action displayed.
+   * Leave empty if you don't care.
    */
-  bool in_stay_action;
+  std::string stay_group;
 
   virtual void draw(DrawingContext& context);
   virtual void update(float elapsed_time);
+
+  /**
+   * Activates the SpriteChange's stay action, if applicable
+   */
+  void set_stay_action();
+
+  /**
+   * Deactivates the SpriteChange's stay action, if applicable
+   */
+  void clear_stay_action();
+
+private:
+  /**
+   * should the stayaction be displayed
+   */
+  bool in_stay_action;
+
+  static std::list<SpriteChange*> all_sprite_changes;
+
 };
 
 }
 
 #endif
-